If you execute this in the JavaScript console you'll see that it does
indeed dynamically reflect the value you type into the EtherText tiddler:
$tw.wiki.extractTiddlerDataItem("EtherConfig","damp")
So, I think the issue is that your simulate() function isn't getting called
when you expect. It looks as though maybe the simulator is only receiving
the value of 'damp' at startup via the initenv() call.
Best wishes
Jeremy
On Fri, Nov 22, 2013 at 9:18 PM, Yoann Babel <[email protected]> wrote:
> Thanks Jeremy.
> It worked.
>
> http://ybabel.fr/code/ether.html
>
> I managed to create some editable parameters :
> * damp: <$edit-text tiddler="EtherConfig" index="damp" default=""
> tag="input" type="text"/>
>
> everything woks fine but when I try to get the value by code, It's not
> refreshed until I close/reopen my EtherTest tiddler. Which is weird.
> Basically, open "EtherTest", changing "damp" shoudl change the simulator
> (the ripples are smaller with 0.9 than 0.99 for example)
>
> This is how I get my data value :
>
> function simulate() {
>
> damp = parseFloat(wiki.extractTiddlerDataItem("EtherConfig", "damp"));
>
> this piece of code is called inside a setInterval (in ether.js)
> timer_id = setInterval(function (sim) { sim();} , 1000/30, simulate);
>
> my problem is that when I edit "damp" in the edit-text widget, the value is
> changed everywhere, except in the simulate() function.
>
> I don't understand why. Is there some kiind of cache to refresh ?
> I have to close and reopen "EtherTest" to make it get the new value of
> "EtherConfig":"damp".
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Jeremy Ruston
mailto:[email protected]
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.