Re: [Discuss-gnuradio] Variable in Delay block

2018-05-30 Thread Yeo Jin Kuang Alvin (IA)
Hi Ron,

Thank you! Managed to get it working. By any chance, you know how to change the 
"delay" using python over time? I tried to use QT Entry GUI shown in the guided 
tutorial, instead of if else function I tried doing for loop

def set_delay_amt(self, delay_amt):
c = 0
for a in range(0,5000):
for b in range(0,6000):
if b == 5999:
c = c + 1
t = c*0.001
delay_amt = 
int(0.04*((3500*(t-2.5))**2 + 227322562.9)**(1/2.0)
self.delay_amt = delay_amt
Qt.QMetaObject.invokeMethod(self._delay_amt_line_edit, 
"setText", Qt.Q_ARG("QString", str(self.delay_amt)))
Self.blocks_delay_0.set_dly(self.delay_amt)

I've tested the code for the one listed below and tested it out using python 
shell, got the values I want.
c = 0
for a in range(0,5000):
for b in range(0,6000):
if b == 5999:
c = c + 1
t = c*0.001
delay_amt = 
int(0.04*((3500*(t-2.5))**2 + 227322562.9)**(1/2.0)

Just that I not sure where to place it in the generated file. Thank you!




From: Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] On Behalf Of Ron 
Economos
Sent: Thursday, 31 May 2018 11:16 AM
To: discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Variable in Delay block


You should also change the Trigger Mode in the QT Time sink to Normal.

Ron
On 05/30/2018 08:05 PM, Ron Economos wrote:

It's just a scaling issue. One sample of delay at 32 ksps is much longer in 
time than one sample of delay at 10 Msps. Try the following changes.

1) Change the number of points in the QT GUI Time sink to 32768.

2) In the QT GUI range block, change the Stop value to 1 and the Step value 
to 100.

Ron
On 05/30/2018 07:39 PM, Yeo Jin Kuang Alvin (IA) wrote:
Hi Ron,

Thanks! It works for me too, but when I increase the samp_rate to 10e6, can't 
see the delay.


From: Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] On Behalf Of Ron 
Economos
Sent: Monday, 28 May 2018 6:08 PM
To: discuss-gnuradio@gnu.org<mailto:discuss-gnuradio@gnu.org>
Subject: Re: [Discuss-gnuradio] Variable in Delay block


It works here. Here's a small flow graph that I tested the delay block 
operation with.

http://www.w6rz.net/delay.grc

Ron
On 05/28/2018 02:33 AM, Yeo Jin Kuang Alvin (IA) wrote:
Hi Ron,

That means the Delay block is able to change as well, but why do I not see the 
delay when simulating on the time sink?

Thanks in advanced!

From: Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] On Behalf Of Ron 
Economos
Sent: Monday, 28 May 2018 5:26 PM
To: discuss-gnuradio@gnu.org<mailto:discuss-gnuradio@gnu.org>
Subject: Re: [Discuss-gnuradio] Variable in Delay block


If a block variable can be changed during run time, it will be underlined in 
the properties dialog. For example, in the Multiply Const block, the variable 
"Constant" can be changed.
[block]

Ron
On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:
Hi all,

Is it possible for me to create a QT GUI Range and put the ID in the Delay of 
the delay block? I tried and the graph doesn't change.





___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Variable in Delay block

2018-05-30 Thread Ron Economos

You should also change the Trigger Mode in the QT Time sink to Normal.

Ron

On 05/30/2018 08:05 PM, Ron Economos wrote:


It's just a scaling issue. One sample of delay at 32 ksps is much 
longer in time than one sample of delay at 10 Msps. Try the following 
changes.


1) Change the number of points in the QT GUI Time sink to 32768.

2) In the QT GUI range block, change the Stop value to 1 and the 
Step value to 100.


Ron

On 05/30/2018 07:39 PM, Yeo Jin Kuang Alvin (IA) wrote:


Hi Ron,

Thanks! It works for me too, but when I increase the samp_rate to 
10e6, can’t see the delay.


*From:*Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] *On 
Behalf Of *Ron Economos

*Sent:* Monday, 28 May 2018 6:08 PM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: [Discuss-gnuradio] Variable in Delay block

It works here. Here's a small flow graph that I tested the delay 
block operation with.


http://www.w6rz.net/delay.grc

Ron

On 05/28/2018 02:33 AM, Yeo Jin Kuang Alvin (IA) wrote:

Hi Ron,

That means the Delay block is able to change as well, but why do
I not see the delay when simulating on the time sink?

Thanks in advanced!

*From:*Discuss-gnuradio
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] *On
Behalf Of *Ron Economos
*Sent:* Monday, 28 May 2018 5:26 PM
*To:* discuss-gnuradio@gnu.org <mailto:discuss-gnuradio@gnu.org>
*Subject:* Re: [Discuss-gnuradio] Variable in Delay block

If a block variable can be changed during run time, it will be
underlined in the properties dialog. For example, in the Multiply
Const block, the variable "Constant" can be changed.

block

Ron

On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:

Hi all,

Is it possible for me to create a QT GUI Range and put the ID
in the Delay of the delay block? I tried and the graph
doesn’t change.



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Variable in Delay block

2018-05-30 Thread Ron Economos
It's just a scaling issue. One sample of delay at 32 ksps is much longer 
in time than one sample of delay at 10 Msps. Try the following changes.


1) Change the number of points in the QT GUI Time sink to 32768.

2) In the QT GUI range block, change the Stop value to 1 and the 
Step value to 100.


Ron

On 05/30/2018 07:39 PM, Yeo Jin Kuang Alvin (IA) wrote:


Hi Ron,

Thanks! It works for me too, but when I increase the samp_rate to 
10e6, can’t see the delay.


*From:*Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] *On 
Behalf Of *Ron Economos

*Sent:* Monday, 28 May 2018 6:08 PM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: [Discuss-gnuradio] Variable in Delay block

It works here. Here's a small flow graph that I tested the delay block 
operation with.


http://www.w6rz.net/delay.grc

Ron

On 05/28/2018 02:33 AM, Yeo Jin Kuang Alvin (IA) wrote:

Hi Ron,

That means the Delay block is able to change as well, but why do I
not see the delay when simulating on the time sink?

Thanks in advanced!

*From:*Discuss-gnuradio
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] *On
Behalf Of *Ron Economos
*Sent:* Monday, 28 May 2018 5:26 PM
*To:* discuss-gnuradio@gnu.org <mailto:discuss-gnuradio@gnu.org>
*Subject:* Re: [Discuss-gnuradio] Variable in Delay block

If a block variable can be changed during run time, it will be
underlined in the properties dialog. For example, in the Multiply
Const block, the variable "Constant" can be changed.

block

Ron

On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:

Hi all,

Is it possible for me to create a QT GUI Range and put the ID
in the Delay of the delay block? I tried and the graph doesn’t
change.



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Variable in Delay block

2018-05-30 Thread Yeo Jin Kuang Alvin (IA)
Hi Ron,

Thanks! It works for me too, but when I increase the samp_rate to 10e6, can't 
see the delay.


From: Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] On Behalf Of Ron 
Economos
Sent: Monday, 28 May 2018 6:08 PM
To: discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Variable in Delay block


It works here. Here's a small flow graph that I tested the delay block 
operation with.

http://www.w6rz.net/delay.grc

Ron
On 05/28/2018 02:33 AM, Yeo Jin Kuang Alvin (IA) wrote:
Hi Ron,

That means the Delay block is able to change as well, but why do I not see the 
delay when simulating on the time sink?

Thanks in advanced!

From: Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] On Behalf Of Ron 
Economos
Sent: Monday, 28 May 2018 5:26 PM
To: discuss-gnuradio@gnu.org<mailto:discuss-gnuradio@gnu.org>
Subject: Re: [Discuss-gnuradio] Variable in Delay block


If a block variable can be changed during run time, it will be underlined in 
the properties dialog. For example, in the Multiply Const block, the variable 
"Constant" can be changed.
[block]

Ron
On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:
Hi all,

Is it possible for me to create a QT GUI Range and put the ID in the Delay of 
the delay block? I tried and the graph doesn't change.




___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Variable in Delay block

2018-05-28 Thread Ron Economos
It works here. Here's a small flow graph that I tested the delay block 
operation with.


http://www.w6rz.net/delay.grc

Ron

On 05/28/2018 02:33 AM, Yeo Jin Kuang Alvin (IA) wrote:


Hi Ron,

That means the Delay block is able to change as well, but why do I not 
see the delay when simulating on the time sink?


Thanks in advanced!

*From:*Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] *On 
Behalf Of *Ron Economos

*Sent:* Monday, 28 May 2018 5:26 PM
*To:* discuss-gnuradio@gnu.org
*Subject:* Re: [Discuss-gnuradio] Variable in Delay block

If a block variable can be changed during run time, it will be 
underlined in the properties dialog. For example, in the Multiply 
Const block, the variable "Constant" can be changed.


block

Ron

On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:

Hi all,

Is it possible for me to create a QT GUI Range and put the ID in
the Delay of the delay block? I tried and the graph doesn’t change.



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Variable in Delay block

2018-05-28 Thread Yeo Jin Kuang Alvin (IA)
Hi Ron,

That means the Delay block is able to change as well, but why do I not see the 
delay when simulating on the time sink?

Thanks in advanced!

From: Discuss-gnuradio 
[mailto:discuss-gnuradio-bounces+yjinkuan=dso.org...@gnu.org] On Behalf Of Ron 
Economos
Sent: Monday, 28 May 2018 5:26 PM
To: discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Variable in Delay block


If a block variable can be changed during run time, it will be underlined in 
the properties dialog. For example, in the Multiply Const block, the variable 
"Constant" can be changed.
[block]

Ron
On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:
Hi all,

Is it possible for me to create a QT GUI Range and put the ID in the Delay of 
the delay block? I tried and the graph doesn't change.



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Variable in Delay block

2018-05-28 Thread Ron Economos
If a block variable can be changed during run time, it will be 
underlined in the properties dialog. For example, in the Multiply Const 
block, the variable "Constant" can be changed.


block

Ron

On 05/28/2018 01:46 AM, Yeo Jin Kuang Alvin (IA) wrote:


Hi all,

Is it possible for me to create a QT GUI Range and put the ID in the 
Delay of the delay block? I tried and the graph doesn’t change.





___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Variable in Delay block

2018-05-28 Thread Yeo Jin Kuang Alvin (IA)
Hi all,

Is it possible for me to create a QT GUI Range and put the ID in the Delay of 
the delay block? I tried and the graph doesn't change.

I also tried generating the python file and created a QT GUI Entry, use the ID 
in the QT GUI Entry (delay_amt) and edited the code

def set_delay_amt(self, delay_amt):
c = 0
for a in range(0,5000):
for b in range(0,6000):
if b == 5999:
c = c + 1
t = c*0.001
delay_amt = 
int(0.04*((3500*(t-2.5))**2 + 227322562.9)**(1/2.0)
self.delay_amt = delay_amt
Qt.QMetaObject.invokeMethod(self._delay_amt_line_edit, 
"setText", Qt.Q_ARG("QString", str(self.delay_amt)))
Self.blocks_delay_0.set_dly(self.delay_amt)

I have tested the values in python shell and I've gotten what I wanted. Just 
that when I run it, there doesn't seems to be a delay changing with time. I 
want to control the delay overtime, to simulate the time take for it to 
transmit and reflect back an object when the object is moving for 5 secs. Does 
this method works or is there a better way of doing this and how?

Thank you in advanced!
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio