Piotr Krysik
2017-09-13 17:08:36 UTC
Hi All,
time_spec_t is a class representing time in UHD. It uses time_t (long
int) for representing full seconds and double for parts of a second.
This format of time is usable to tell USRPs when to do certain tasks. It
is also very usable for operations on time without loosing precision.
In c++ time_spec_t can be constructed from time represented by a double
(not precise if number of full seconds is large) or from time_t and
double. Both constructors are exposed by SWIG in Python.
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/gnuradio/uhd/uhd_swig.py", line
1576, in __init__
this = _uhd_swig.new_time_spec_t(*args)
NotImplementedError: Wrong number or type of arguments for overloaded
function 'new_time_spec_t'.
Possible C/C++ prototypes are:
uhd::time_spec_t::time_spec_t(double)
uhd::time_spec_t::time_spec_t(time_t,double)
uhd::time_spec_t::time_spec_t(time_t,long,double)
Somehow Python's integer is not recognized as compatible with time_t
parameter in the second constructor
(uhd::time_spec_t::time_spec_t(time_t,double) ).
My question:
Is there a way to use time_spec_t's constructor
uhd::time_spec_t::time_spec_t(time_t,double) from Python interface
exposed by GNU Radio? In my opinion there should be, otherwise why to
expose it through SWIG.
--
Best Regards,
Piotr Krysik
time_spec_t is a class representing time in UHD. It uses time_t (long
int) for representing full seconds and double for parts of a second.
This format of time is usable to tell USRPs when to do certain tasks. It
is also very usable for operations on time without loosing precision.
In c++ time_spec_t can be constructed from time represented by a double
(not precise if number of full seconds is large) or from time_t and
double. Both constructors are exposed by SWIG in Python.
from gnuradio import uhd
uhd.time_spec(10)
uhd.time_spec(10,0.1)
Traceback (most recent call last):uhd.time_spec(10)
uhd.time_spec(10,0.1)
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/gnuradio/uhd/uhd_swig.py", line
1576, in __init__
this = _uhd_swig.new_time_spec_t(*args)
NotImplementedError: Wrong number or type of arguments for overloaded
function 'new_time_spec_t'.
Possible C/C++ prototypes are:
uhd::time_spec_t::time_spec_t(double)
uhd::time_spec_t::time_spec_t(time_t,double)
uhd::time_spec_t::time_spec_t(time_t,long,double)
Somehow Python's integer is not recognized as compatible with time_t
parameter in the second constructor
(uhd::time_spec_t::time_spec_t(time_t,double) ).
My question:
Is there a way to use time_spec_t's constructor
uhd::time_spec_t::time_spec_t(time_t,double) from Python interface
exposed by GNU Radio? In my opinion there should be, otherwise why to
expose it through SWIG.
--
Best Regards,
Piotr Krysik