W dniu 24.02.2015 o 10:59, Martin pisze: > For this application it would be helpfull if you could set the > start_time from grc. > > In general it would be very helpfull if you could add your own python > code to grc without having to edit it manually after generating. > > A "codeblock" in a similar way the import block is implemented would > be very helpful. Just a block where you can add code. You should > probably be able to choose where the code is added. > > at the top of the file after all imports > at the beginning of the constructor of the flowgraph > at the end of the constructor of the flow_graph > as a seperate method of the flowgraph > at the start of main > at the end of main. > > We could make it a feature request. > Or maybe I should just implement it.
Martin, The solution proposed by you would be very good to give to the user ability to do something more sophisticated than gnuradio-companion supports at any point in the future. However in my opinion ability to trigger USRP at a specified time is quite basic feature of the device. Maybe it would be better to add the start_time parameter in gnuradio-companion UHD blocks (source and sink) that would be parsed into appropriate python code. To keep it simple to implement the value given could be as a float in seconds that would be directly converted into USRP's clock value like this: uhd.time_spec_t(start_time) and it would be user task to assign proper value like: start_time: time.mktime(time.strptime(time_string,'%d.%m.%Y %H:%M:%S')) #if he uses GPSDO or start_time: self.uhd_usrp_source.get_time_now()+4 #if he just to start 4 seconds from now The examples of how to use this parameter could be documented in the description of the blocks so each user wouldn't have to find this out on his own. The other advantage of this approach - it would also give a simple way to synchronize UHD source and sink from gnuradio-companion. Best Regards, Piotr Krysik _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio