[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 06/13: added subtraction and addition to ti
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 06/13: added subtraction and addition to time_spec_t |
Date: |
Tue, 15 Apr 2014 23:55:53 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 9df52c1b0c598872c7ae1cd92c885ef1e92f4a4f
Author: Marcus Müller <address@hidden>
Date: Mon Apr 14 23:47:50 2014 +0200
added subtraction and addition to time_spec_t
---
gr-uhd/python/uhd/qa_uhd.py | 8 ++++++++
gr-uhd/swig/uhd_swig.i | 15 +++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/gr-uhd/python/uhd/qa_uhd.py b/gr-uhd/python/uhd/qa_uhd.py
index 511c098..4df0d42 100644
--- a/gr-uhd/python/uhd/qa_uhd.py
+++ b/gr-uhd/python/uhd/qa_uhd.py
@@ -35,6 +35,14 @@ class test_uhd(gr_unittest.TestCase):
They may not have a UHD device connected, etc. Don't try to run
anything"""
pass
+ def test_time_spec_t (self):
+ seconds = 42.0
+ time = uhd.time_spec_t(seconds)
+ twice_time = time + time;
+ zero_time = time - time;
+ self.assertEqual(time.get_real_secs() * 2, seconds * 2 )
+ self.assertEqual(time.get_real_secs() - time.get_real_secs() , 0.0)
+
def test_stream_args_channel_foo(self):
"""
Try to manipulate the stream args channels for proper swig'ing checks.
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i
index c98416f..4eaef91 100644
--- a/gr-uhd/swig/uhd_swig.i
+++ b/gr-uhd/swig/uhd_swig.i
@@ -84,6 +84,21 @@
%include <uhd/types/time_spec.hpp>
+%extend uhd::time_spec_t{
+ uhd::time_spec_t __add__(const uhd::time_spec_t &what)
+ {
+ uhd::time_spec_t temp = *self;
+ temp += what;
+ return temp;
+ }
+ uhd::time_spec_t __sub__(const uhd::time_spec_t &what)
+ {
+ uhd::time_spec_t temp = *self;
+ temp -= what;
+ return temp;
+ }
+};
+
%include <uhd/types/stream_cmd.hpp>
%include <uhd/types/clock_config.hpp>
- [Commit-gnuradio] [gnuradio] 01/13: grc: option to hide disabled blocks, (continued)
- [Commit-gnuradio] [gnuradio] 01/13: grc: option to hide disabled blocks, git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 10/13: Merge remote-tracking branch 'bolin/master', git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 08/13: Merge remote-tracking branch 'gnuradio-wg-grc/grc_hide_disabled_blocks', git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 04/13: Fix inconsistent naming and docstring, git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 12/13: Merge remote-tracking branch 'mmueller/gr_uhd_time_spec_t_fix', git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 13/13: Merge remote-tracking branch 'tkuester/documentation', git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 09/13: Merge remote-tracking branch 'gnuradio-wg-grc/grc_block_and_prefs_path', git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 05/13: socket_pdu: fixed resolver issue by applying same resolver as in udp_sink., git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 11/13: Merge remote-tracking branch 'mmueller/socket_pdu_fix_resolver_issue', git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 03/13: grc: nicer output of blocks paths and prefs file, git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 06/13: added subtraction and addition to time_spec_t,
git <=
- [Commit-gnuradio] [gnuradio] 02/13: grc: honour order of block paths, print them out on startup, override hier block and pref file path with GRC_HIER_PATH & GRC_PREFS_PATH, git, 2014/04/15
- [Commit-gnuradio] [gnuradio] 07/13: documentation: Bit handling gotchas explained, git, 2014/04/15