Forum: GNU Radio Access to history before there is one (Block writing question)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jason U. (Guest)
on 2009-03-11 21:10
(Received via mailing list)
I'm in the process of writing a basic block inherited from
gr_sync_interpolator  which uses the past values to do stuff.

When the block first starts, the history is populated with zeros, is
there some way to get a pointer to the history in the constructor so I
can change the initial values?

Thanks

Jason
Eric B. (Guest)
on 2009-03-11 21:46
(Received via mailing list)
On Wed, Mar 11, 2009 at 02:10:19PM -0500, Jason U. wrote:
> I'm in the process of writing a basic block inherited from
> gr_sync_interpolator  which uses the past values to do stuff.
>
> When the block first starts, the history is populated with zeros, is
> there some way to get a pointer to the history in the constructor so I
> can change the initial values?
>
> Thanks
> Jason

Sorry, no.

Eric
Jason U. (Guest)
on 2009-04-02 18:31
(Received via mailing list)
>
> Sorry, no.
>
> Eric
>

OK,

Is there a way to distinguish between an uninitialized history (which
seems to be all 0's) and a history whose data is all 0's?

Or perhaps some way that the work function knows this that it is the
first time being called (I am currently kludging it with a class
variable, 'cleared_buffer')

Thanks

Jason
Eric B. (Guest)
on 2009-04-02 18:41
(Received via mailing list)
On Thu, Apr 02, 2009 at 09:30:47AM -0500, Jason U. wrote:
> >
> > Sorry, no.
> >
> > Eric
> >
>
> OK,
>
> Is there a way to distinguish between an uninitialized history (which
> seems to be all 0's) and a history whose data is all 0's?

No.  0 == 0 :-)

> Or perhaps some way that the work function knows this that it is the
> first time being called (I am currently kludging it with a class
> variable, 'cleared_buffer')

The instance variable should do it.

Eric
This topic is locked and can not be replied to.