summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-audio/lib/windows/windows_sink.cc14
-rw-r--r--gr-audio/lib/windows/windows_source.cc14
-rw-r--r--gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc2
-rw-r--r--gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc3
-rw-r--r--gr-dtv/lib/dvb/dvb_bch_bb_impl.cc2
-rw-r--r--gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc8
-rw-r--r--gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc1
-rw-r--r--gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc1
-rw-r--r--gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc2
-rw-r--r--gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc2
-rw-r--r--gr-uhd/apps/uhd_app.py53
-rw-r--r--gr-uhd/lib/usrp_sink_impl.cc8
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc8
-rw-r--r--grc/core/Block.py5
-rw-r--r--grc/core/utils/epy_block_io.py8
15 files changed, 103 insertions, 28 deletions
diff --git a/gr-audio/lib/windows/windows_sink.cc b/gr-audio/lib/windows/windows_sink.cc
index 52456dbdc4..bd9e0e5660 100644
--- a/gr-audio/lib/windows/windows_sink.cc
+++ b/gr-audio/lib/windows/windows_sink.cc
@@ -93,7 +93,7 @@ namespace gr {
std::runtime_error("audio_windows_sink:open_waveout_device() failed");
}
else if (verbose) {
- GR_LOG_INFO(logger, "Opened windows waveout device");
+ GR_LOG_INFO(d_logger, "Opened windows waveout device");
}
d_buffers = new LPWAVEHDR[nPeriods];
for (int i = 0; i < nPeriods; i++)
@@ -104,7 +104,7 @@ namespace gr {
d_buffers[i]->dwBufferLength = d_buffer_size;
d_buffers[i]->lpData = new CHAR[d_buffer_size];
}
- if (verbose) GR_LOG_INFO(logger, boost::format("Initialized %1% %2%ms audio buffers, total memory used: %3$0.2fkB") % (nPeriods) % (CHUNK_TIME * 1000) % ((d_buffer_size * nPeriods) / 1024.0));
+ if (verbose) GR_LOG_INFO(d_logger, boost::format("Initialized %1% %2%ms audio buffers, total memory used: %3$0.2fkB") % (nPeriods) % (CHUNK_TIME * 1000) % ((d_buffer_size * nPeriods) / 1024.0));
}
windows_sink::~windows_sink()
@@ -252,7 +252,7 @@ namespace gr {
result = num;
}
else {
- GR_LOG_INFO(logger, boost::format("Warning: waveOut deviceID %d was not found, defaulting to WAVE_MAPPER") % num);
+ GR_LOG_INFO(d_logger, boost::format("Warning: waveOut deviceID %d was not found, defaulting to WAVE_MAPPER") % num);
result = WAVE_MAPPER;
}
@@ -271,10 +271,10 @@ namespace gr {
{
result = i;
}
- if (verbose) GR_LOG_INFO(logger, boost::format("WaveOut Device %d: %s") % i % woc.szPname);
+ if (verbose) GR_LOG_INFO(d_logger, boost::format("WaveOut Device %d: %s") % i % woc.szPname);
}
if (result == -1) {
- GR_LOG_INFO(logger, boost::format("Warning: waveOut device '%s' was not found, defaulting to WAVE_MAPPER") % szDeviceName);
+ GR_LOG_INFO(d_logger, boost::format("Warning: waveOut device '%s' was not found, defaulting to WAVE_MAPPER") % szDeviceName);
result = WAVE_MAPPER;
}
}
@@ -306,14 +306,14 @@ namespace gr {
// would know the device ID so at the moment we will ignore that setting
// and stick with WAVE_MAPPER
u_device_id = find_device(d_device_name);
- if (verbose) GR_LOG_INFO(logger, boost::format("waveOut Device ID: %1%") % (u_device_id));
+ if (verbose) GR_LOG_INFO(d_logger, boost::format("waveOut Device ID: %1%") % (u_device_id));
// Check if the sampling rate/bits/channels are good to go with the device.
MMRESULT supported = is_format_supported(&wave_format, u_device_id);
if (supported != MMSYSERR_NOERROR) {
char err_msg[50];
waveOutGetErrorText(supported, err_msg, 50);
- GR_LOG_INFO(logger, boost::format("format error: %s") % err_msg);
+ GR_LOG_INFO(d_logger, boost::format("format error: %s") % err_msg);
perror("audio_windows_sink: Requested audio format is not supported by device driver");
return -1;
}
diff --git a/gr-audio/lib/windows/windows_source.cc b/gr-audio/lib/windows/windows_source.cc
index f458fa474e..372a8ba3a8 100644
--- a/gr-audio/lib/windows/windows_source.cc
+++ b/gr-audio/lib/windows/windows_source.cc
@@ -97,7 +97,7 @@ namespace gr {
std::runtime_error("audio_windows_source:open_wavein_device() failed");
}
else if (verbose) {
- GR_LOG_INFO(logger, "Opened windows wavein device");
+ GR_LOG_INFO(d_logger, "Opened windows wavein device");
}
lp_buffers = new LPWAVEHDR[nPeriods];
for (int i = 0; i < nPeriods; i++)
@@ -118,7 +118,7 @@ namespace gr {
waveInAddBuffer(d_h_wavein, lp_buffer, sizeof(WAVEHDR));
}
waveInStart(d_h_wavein);
- if (verbose) GR_LOG_INFO(logger, boost::format("Initialized %1% %2%ms audio buffers, total memory used: %3$0.2fkB") % (nPeriods) % (CHUNK_TIME * 1000) % ((d_buffer_size * nPeriods) / 1024.0));
+ if (verbose) GR_LOG_INFO(d_logger, boost::format("Initialized %1% %2%ms audio buffers, total memory used: %3$0.2fkB") % (nPeriods) % (CHUNK_TIME * 1000) % ((d_buffer_size * nPeriods) / 1024.0));
}
windows_source::~windows_source()
@@ -237,7 +237,7 @@ namespace gr {
result = num;
}
else {
- GR_LOG_INFO(logger, boost::format("Warning: waveIn deviceID %d was not found, defaulting to WAVE_MAPPER") % num);
+ GR_LOG_INFO(d_logger, boost::format("Warning: waveIn deviceID %d was not found, defaulting to WAVE_MAPPER") % num);
result = WAVE_MAPPER;
}
@@ -256,10 +256,10 @@ namespace gr {
{
result = i;
}
- if (verbose) GR_LOG_INFO(logger, boost::format("WaveIn Device %d: %s") % i % woc.szPname);
+ if (verbose) GR_LOG_INFO(d_logger, boost::format("WaveIn Device %d: %s") % i % woc.szPname);
}
if (result == -1) {
- GR_LOG_INFO(logger, boost::format("Warning: waveIn device '%s' was not found, defaulting to WAVE_MAPPER") % szDeviceName);
+ GR_LOG_INFO(d_logger, boost::format("Warning: waveIn device '%s' was not found, defaulting to WAVE_MAPPER") % szDeviceName);
result = WAVE_MAPPER;
}
}
@@ -291,14 +291,14 @@ namespace gr {
// would know the device ID so at the moment we will ignore that setting
// and stick with WAVE_MAPPER
u_device_id = find_device(d_device_name);
- if (verbose) GR_LOG_INFO(logger, boost::format("waveIn Device ID: %1%") % (u_device_id));
+ if (verbose) GR_LOG_INFO(d_logger, boost::format("waveIn Device ID: %1%") % (u_device_id));
// Check if the sampling rate/bits/channels are good to go with the device.
MMRESULT supported = is_format_supported(&wave_format, u_device_id);
if (supported != MMSYSERR_NOERROR) {
char err_msg[50];
waveInGetErrorText(supported, err_msg, 50);
- GR_LOG_INFO(logger, boost::format("format error: %s") % err_msg);
+ GR_LOG_INFO(d_logger, boost::format("format error: %s") % err_msg);
perror("audio_windows_source: Requested audio format is not supported by device driver");
return -1;
}
diff --git a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
index d14b46a0e1..123e7fb15e 100644
--- a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
+++ b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
@@ -326,7 +326,7 @@ namespace gr {
void
dvb_bbheader_bb_impl::build_crc8_table(void)
{
- int r,crc;
+ int r, crc;
for (int i = 0; i < 256; i++) {
r = i;
diff --git a/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc b/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc
index ef1c1841ad..8e86eb4f64 100644
--- a/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc
+++ b/gr-dtv/lib/dvb/dvb_bbscrambler_bb_impl.cc
@@ -279,8 +279,7 @@ namespace gr {
unsigned char *out = (unsigned char *) output_items[0];
for (int i = 0; i < noutput_items; i += kbch) {
- for (int j = 0; j < (int)kbch; ++j)
- {
+ for (int j = 0; j < (int)kbch; ++j) {
out[i + j] = in[i + j] ^ bb_randomise[j];
}
}
diff --git a/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc b/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc
index b1ebb6db79..8d89f9b04a 100644
--- a/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc
+++ b/gr-dtv/lib/dvb/dvb_bch_bb_impl.cc
@@ -385,7 +385,7 @@ namespace gr {
void
dvb_bch_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
- ninput_items_required[0] = (noutput_items / nbch) * kbch;
+ ninput_items_required[0] = (noutput_items / nbch) * kbch;
}
/*
diff --git a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc
index 568aac940a..84328e1200 100644
--- a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc
+++ b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc
@@ -369,12 +369,12 @@ namespace gr {
void
dvb_ldpc_bb_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
- ninput_items_required[0] = (noutput_items / frame_size) * nbch;
+ ninput_items_required[0] = (noutput_items / frame_size) * nbch;
}
#define LDPC_BF(TABLE_NAME, ROWS) \
for (int row = 0; row < ROWS; row++) { \
- for(int n = 0; n < 360; n++) { \
+ for (int n = 0; n < 360; n++) { \
for (int col = 1; col <= TABLE_NAME[row][0]; col++) { \
ldpc_encode.p[index] = (TABLE_NAME[row][col] + (n * q)) % pbits; \
ldpc_encode.d[index] = im; \
@@ -606,7 +606,7 @@ for (int row = 0; row < ROWS; row++) { \
unsigned char *out = (unsigned char *) output_items[0];
const unsigned char *d;
unsigned char *p;
- unsigned char *b;
+ unsigned char *b = (unsigned char *) output_items[0];
unsigned char *s;
// Calculate the number of parity bits
int plen = (frame_size_real + Xp) - nbch;
@@ -657,7 +657,7 @@ for (int row = 0; row < ROWS; row++) { \
p[j] ^= p[j-1];
}
if (signal_constellation == MOD_128APSK) {
- for(int j = 0; j < 6; j++) {
+ for (int j = 0; j < 6; j++) {
p[j + plen] = 0;
}
}
diff --git a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
index 3ae1debb01..e3fb039c50 100644
--- a/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
+++ b/gr-dtv/lib/dvbs2/dvbs2_modulator_bc_impl.cc
@@ -53,6 +53,7 @@ namespace gr {
m_bpsk[0][1] = gr_complex((r1 * cos(5.0 * M_PI / 4.0)), (r1 * sin(5.0 * M_PI / 4.0)));
m_bpsk[1][0] = gr_complex((r1 * cos(5.0 * M_PI / 4.0)), (r1 * sin(M_PI / 4.0)));
m_bpsk[1][1] = gr_complex((r1 * cos(M_PI / 4.0)), (r1 * sin(5.0 * M_PI /4.0)));
+ break;
case MOD_QPSK:
m_qpsk[0] = gr_complex((r1 * cos(M_PI / 4.0)), (r1 * sin(M_PI / 4.0)));
m_qpsk[1] = gr_complex((r1 * cos(7 * M_PI / 4.0)), (r1 * sin(7 * M_PI / 4.0)));
diff --git a/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc b/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc
index 688ad7a40c..5da18b1d21 100644
--- a/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc
+++ b/gr-dtv/lib/dvbs2/dvbs2_physical_cc_impl.cc
@@ -71,6 +71,7 @@ namespace gr {
}
else {
frame_size = FRAME_SIZE_MEDIUM - MEDIUM_PUNCTURING + EXTRA_PILOT_SYMBOLS_SET1;
+ type = 0;
pilots = PILOTS_ON; /* force pilots on for VL-SNR */
}
diff --git a/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc
index f89d2af7f7..bda49e9540 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_freqinterleaver_cc_impl.cc
@@ -186,6 +186,8 @@ namespace gr {
max_states = 0;
logic = &logic1k[0];
xor_size = 0;
+ bitpermeven = &bitperm1keven[0];
+ bitpermodd = &bitperm1kodd[0];
break;
}
switch (fftsize) {
diff --git a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc
index 28e7c4fac2..b92738603b 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_modulator_bc_impl.cc
@@ -500,7 +500,7 @@ namespace gr {
void
dvbt2_modulator_bc_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
- ninput_items_required[0] = noutput_items;
+ ninput_items_required[0] = noutput_items;
}
int
diff --git a/gr-uhd/apps/uhd_app.py b/gr-uhd/apps/uhd_app.py
index d2e59b8d3f..f9b08a6457 100644
--- a/gr-uhd/apps/uhd_app.py
+++ b/gr-uhd/apps/uhd_app.py
@@ -135,6 +135,15 @@ class UHDApp(object):
))
return specs
+ def normalize_lo_source_export_sel(self, args):
+ lo_source = [x.strip() for x in args.lo_source.split(",")]
+ lo_export = [x.strip() for x in args.lo_export.split(",")]
+ if len(lo_source) != len(self.channels):
+ raise ValueError("Invalid number of lo-source settings {n} for {c} channels. Must be one argument per channel.".format(n=len(lo_source), c=len(args.channels)))
+ if len(lo_export) != len(self.channels):
+ raise ValueError("Invalid number of lo-export settings {n} for {c} channels. Must be one argument per channel.".format(n=len(lo_source), c=len(args.channels)))
+ return (lo_source, lo_export)
+
def async_callback(self, msg):
"""
Call this when USRP async metadata needs printing.
@@ -204,6 +213,32 @@ class UHDApp(object):
else:
treq = uhd.tune_request(args.freq)
self.has_lo_sensor = 'lo_locked' in self.usrp.get_sensor_names()
+ # Set LO export and LO source operation
+ if (args.lo_export is not None) and (args.lo_source is not None):
+ (args.lo_source,args.lo_export) = self.normalize_lo_source_export_sel(args)
+ for chan,lo_source,lo_export in zip(self.channels,args.lo_source,args.lo_export):
+ if (lo_source == "None") or (lo_export == "None"):
+ continue
+ if lo_export == "True":
+ #If channel is LO source set frequency and store response
+ self.usrp.set_lo_export_enabled(True, uhd.ALL_LOS, chan)
+ if lo_source == "internal":
+ self.lo_source_channel = chan
+ tune_resp = self.usrp.set_center_freq(treq,chan)
+ self.usrp.set_lo_source(lo_source, uhd.ALL_LOS,chan)
+ # Use lo source tune response to tune dsp_freq on remaining channels
+ if getattr(args, 'lo_offset', None) is not None:
+ treq = uhd.tune_request(target_freq=args.freq, rf_freq=args.freq+args.lo_offset, rf_freq_policy=uhd.tune_request.POLICY_MANUAL,
+ dsp_freq=tune_resp.actual_dsp_freq,
+ dsp_freq_policy=uhd.tune_request.POLICY_MANUAL)
+ else:
+ treq = uhd.tune_request(target_freq=args.freq, rf_freq=args.freg, rf_freq_policy=uhd.tune_request.POLICY_MANUAL,
+ dsp_freq=tune_resp.actual_dsp_freq,
+ dsp_freq_policy=uhd.tune_request.POLICY_MANUAL)
+ for chan in args.channels:
+ if chan == self.lo_source_channel:
+ continue
+ self.usrp.set_center_freq(treq,chan)
# Make sure tuning is synched:
command_time_set = False
if len(self.channels) > 1:
@@ -265,6 +300,22 @@ class UHDApp(object):
treq = uhd.tune_request(freq, self.args.lo_offset)
else:
treq = uhd.tune_request(freq)
+ # Special TwinRX tuning due to LO sharing
+ if getattr(self, 'lo_source_channel', None) is not None:
+ tune_resp = self.usrp.set_center_freq(treq, self.lo_source_channel)
+ if getattr(self.args, 'lo_offset', None) is not None:
+ treq = uhd.tune_request(target_freq=freq, rf_freq=freq+self.args.lo_offset, rf_freq_policy=uhd.tune_request.POLICY_MANUAL,
+ dsp_freq=tune_resp.actual_dsp_freq,
+ dsp_freq_policy=uhd.tune_request.POLICY_MANUAL)
+ else:
+ treq = uhd.tune_request(target_freq=freq, rf_freq=freq, rf_freq_policy=uhd.tune_reqest.POLICY_MANUAL,
+ dsp_freq=tune_resp.actual_dsp_freq,
+ dsp_freq_policy=uhd.tune_request.POLICY_MANUAL)
+ for chan in self.channels:
+ if chan == self.lo_source_channel:
+ continue
+ self.usrp.set_center_freq(treq,chan)
+
# Make sure tuning is synched:
command_time_set = False
if len(self.channels) > 1 and not skip_sync:
@@ -333,6 +384,8 @@ class UHDApp(object):
if allow_mimo:
group.add_argument("-c", "--channels", default=[0,], type=cslist,
help="Select {xx} Channels".format(xx=tx_or_rx))
+ group.add_argument("--lo-export", help="Set TwinRX LO export {None, True, False} for each channel with a comma-separated list. None skips a channel.")
+ group.add_argument("--lo-source", help="Set TwinRX LO source {None, internal, companion, external} for each channel with a comma-separated list. None skips this channel. ")
group.add_argument("--otw-format", choices=['sc16', 'sc12', 'sc8'], default='sc16',
help="Choose over-the-wire data format")
group.add_argument("--stream-args", default="", help="Set additional stream arguments")
diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc
index c3ac45e29a..bd56e992fd 100644
--- a/gr-uhd/lib/usrp_sink_impl.cc
+++ b/gr-uhd/lib/usrp_sink_impl.cc
@@ -169,12 +169,16 @@ namespace gr {
void usrp_sink_impl::set_normalized_gain(double norm_gain, size_t chan)
{
+#ifdef UHD_USRP_MULTI_USRP_NORMALIZED_GAIN
+ _dev->set_normalized_tx_gain(norm_gain, chan);
+#else
if (norm_gain > 1.0 || norm_gain < 0.0) {
throw std::runtime_error("Normalized gain out of range, must be in [0, 1].");
}
::uhd::gain_range_t gain_range = get_gain_range(chan);
double abs_gain = (norm_gain * (gain_range.stop() - gain_range.start())) + gain_range.start();
set_gain(abs_gain, chan);
+#endif
}
double
@@ -194,6 +198,9 @@ namespace gr {
double
usrp_sink_impl::get_normalized_gain(size_t chan)
{
+#ifdef UHD_USRP_MULTI_USRP_NORMALIZED_GAIN
+ return _dev->get_normalized_tx_gain(chan);
+#else
::uhd::gain_range_t gain_range = get_gain_range(chan);
double norm_gain =
(get_gain(chan) - gain_range.start()) /
@@ -202,6 +209,7 @@ namespace gr {
if (norm_gain > 1.0) return 1.0;
if (norm_gain < 0.0) return 0.0;
return norm_gain;
+#endif
}
std::vector<std::string>
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index e19367e51c..11b6300406 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -184,12 +184,16 @@ namespace gr {
void usrp_source_impl::set_normalized_gain(double norm_gain, size_t chan)
{
+#ifdef UHD_USRP_MULTI_USRP_NORMALIZED_GAIN
+ _dev->set_normalized_rx_gain(norm_gain, chan);
+#else
if (norm_gain > 1.0 || norm_gain < 0.0) {
throw std::runtime_error("Normalized gain out of range, must be in [0, 1].");
}
::uhd::gain_range_t gain_range = get_gain_range(chan);
double abs_gain = (norm_gain * (gain_range.stop() - gain_range.start())) + gain_range.start();
set_gain(abs_gain, chan);
+#endif
}
double
@@ -209,6 +213,9 @@ namespace gr {
double
usrp_source_impl::get_normalized_gain(size_t chan)
{
+#ifdef UHD_USRP_MULTI_USRP_NORMALIZED_GAIN
+ return _dev->get_normalized_rx_gain(chan);
+#else
::uhd::gain_range_t gain_range = get_gain_range(chan);
double norm_gain =
(get_gain(chan) - gain_range.start()) /
@@ -217,6 +224,7 @@ namespace gr {
if (norm_gain > 1.0) return 1.0;
if (norm_gain < 0.0) return 0.0;
return norm_gain;
+#endif
}
std::vector<std::string>
diff --git a/grc/core/Block.py b/grc/core/Block.py
index 737142442b..f8179b113f 100644
--- a/grc/core/Block.py
+++ b/grc/core/Block.py
@@ -462,10 +462,11 @@ class Block(Element):
iter_ports = iter(ports)
ports_new = []
port_current = next(iter_ports, None)
- for key, port_type in port_specs:
+ for key, port_type, vlen in port_specs:
reuse_port = (
port_current is not None and
port_current.get_type() == port_type and
+ port_current.get_vlen() == vlen and
(key.isdigit() or port_current.get_key() == key)
)
if reuse_port:
@@ -476,6 +477,8 @@ class Block(Element):
if port_type == 'message':
n['name'] = key
n['optional'] = '1'
+ if vlen > 1:
+ n['vlen'] = str(vlen)
port = platform.Port(block=self, n=n, dir=direction)
ports_new.append(port)
# replace old port list with new one
diff --git a/grc/core/utils/epy_block_io.py b/grc/core/utils/epy_block_io.py
index 4eb4d6d4e5..a094ab7ad5 100644
--- a/grc/core/utils/epy_block_io.py
+++ b/grc/core/utils/epy_block_io.py
@@ -17,14 +17,15 @@ BlockIO = collections.namedtuple('BlockIO', 'name cls params sinks sources doc c
def _ports(sigs, msgs):
ports = list()
for i, dtype in enumerate(sigs):
- port_type = TYPE_MAP.get(dtype.name, None)
+ port_type = TYPE_MAP.get(dtype.base.name, None)
if not port_type:
raise ValueError("Can't map {0!r} to GRC port type".format(dtype))
- ports.append((str(i), port_type))
+ vlen = dtype.shape[0] if len(dtype.shape) > 0 else 1
+ ports.append((str(i), port_type, vlen))
for msg_key in msgs:
if msg_key == 'system':
continue
- ports.append((msg_key, 'message'))
+ ports.append((msg_key, 'message', 1))
return ports
@@ -122,4 +123,3 @@ class blk(gr.sync_block):
"""
from pprint import pprint
pprint(dict(extract(blk_code)._asdict()))
-