Grigory Dorokhov | 1 Jun 04:10
Picon
Picon
Favicon

Re: additional attributes in visualisation file

On Fri, 29 May 2009 16:00:35 +0530
Prabhu Ramachandran <prabhu@...> wrote:

> Grigory Dorokhov wrote:
> > My program add rpc control to mayavi. It allows to create scenes
> > and etc. in mayavi from rpc clients. And it needs some kind of id
> > for objects in scene tree in mayavi. A user can save visualisation in mayavi and then load it later and have
these id restored so the rpc client that has created them does not lose link with created objects.
> > I tried to use scene names as ids but have found that name are not restored after visualisation has been loaded.
> 
> I've checked in a small fix for this in [23691].  Let me know if it 
> works for you.  If you don't want to upgrade to SVN and would rather 
> patch your existing code here is the changeset:
> 
> https://svn.enthought.com/enthought/changeset/23691
> 
> HTH.
> prabhu

It almost works.
Scene names are restored but tabs of 3D scene view still have 'TVTK scene ...' labels.

--

-- 
Grigory Dorokhov
Computational Research Centre of Expertise
Science Faculty, UTS, NSW
t: 2265

UTS CRICOS Provider Code:  00099F
DISCLAIMER: This email message and any accompanying attachments may contain confidential information. 
(Continue reading)

David Fokkema | 1 Jun 16:25
Picon
Favicon

Trait updates from another thread

Hi list,

I'm writing a small application which interacts with an experimental
setup, with separate threads for listening on the bus (listener) and
subsequently handling the messages received (handler). The Traits UI
stays in the main thread. I have:

model = ElectronicsBox()
message_queue = Queue.Queue()
shutdown = threading.Event()

lt = threading.Thread(target=listener, args=(message_queue, device,
                                             shutdown))
lt.start()

ht = threading.Thread(target=handler, args=(message_queue, model,
shutdown))
ht.start()

try:
    model.configure_traits(view=hisparc_box_view)
except:
    traceback.print_exc()

print "Shutting down threads..."
shutdown.set()
print "Waiting for threads..."
lt.join()
ht.join()
print "Done."
(Continue reading)

Alexander Michael | 1 Jun 18:47
Picon

Re: Trait updates from another thread

On Mon, Jun 1, 2009 at 10:25 AM, David Fokkema <dfokkema@...> wrote:
> I'm writing a small application which interacts with an experimental
> setup, with separate threads for listening on the bus (listener) and
> subsequently handling the messages received (handler). The Traits UI
> stays in the main thread.
...
> This works, but I have the following problem. My model defines a plot.
> In the handler (which I pass the model instance) I try to update the
> data using model.traces.set_data('ch1', event.ch1), where traces is an
> ArrayPlotData instance and event is a class instance which parses the
> message and stores data. This sort of works the very first time (the
> axes are not updated, but the data shows), but then my GUI sort of
> hangs. The plot's zoomtool is nonfunctioning and I can't edit text boxes
> anymore. Sometimes it unfreezes, but usually not. I can, however, simply
> click the close window button and everything shuts down cleanly.
...

In principle, I believe this should work. I'm a threading novice, but
have attached an example that I use as my base template for this task
(although it doesn't install any tools, so maybe it has problems as
well). It wasn't clear to me (but maybe obvious to the more
knowledgeable) if you were actually launching the worker threads from
the GUI thread. I create the worker threads in a handler, which seems
to accomplish the task.
_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
(Continue reading)

Robert Kern | 1 Jun 18:54
Gravatar

Re: Trait updates from another thread

On Mon, Jun 1, 2009 at 09:25, David Fokkema <dfokkema <at> ileos.nl> wrote:
> Hi list,
>
> I'm writing a small application which interacts with an experimental
> setup, with separate threads for listening on the bus (listener) and
> subsequently handling the messages received (handler). The Traits UI
> stays in the main thread. I have:
>
> model = ElectronicsBox()
> message_queue = Queue.Queue()
> shutdown = threading.Event()
>
> lt = threading.Thread(target=listener, args=(message_queue, device,
>                                             shutdown))
> lt.start()
>
> ht = threading.Thread(target=handler, args=(message_queue, model,
> shutdown))
> ht.start()
>
> try:
>    model.configure_traits(view=hisparc_box_view)
> except:
>    traceback.print_exc()
>
> print "Shutting down threads..."
> shutdown.set()
> print "Waiting for threads..."
> lt.join()
> ht.join()
(Continue reading)

Will Lee | 1 Jun 20:44
Picon

Re: Bug with id and minimized window

Thanks for the quick response.  Can you tell me what change set it is?

Will

On Fri, May 29, 2009 at 2:08 PM, bryce hendrix <bhendrix-SCgzsaguwNrby3iVrkZq2A@public.gmane.org> wrote:
Will Lee wrote:
> I've searched on-line but I couldn't find any info on this issue.
>
> Essentially, I have a traits view that uses an the "id" attribute that
> saves the dimension of the window.  However, if I close the window
> when it's minimized in Windows XP, it'll set the size of such window
> to 0 such that opening the same app next time will not restore the
> size properly.  My users are very frustrated with this behavior since
> it looks like the application has disappeared and you can only
> maximize and minimize it.

Will, I've made a change to TraitsBackendWX in svn, though I lack a
Windows box to test this fix on. If you can test it & let me know if it
worked, that would be great, otherwise I'll test my fix later tonight.

Bryce
_______________________________________________
Enthought-dev mailing list
Enthought-dev-oRDGkvazHdacsI7C1d+pp9BPR1lH4CV8@public.gmane.org
https://mail.enthought.com/mailman/listinfo/enthought-dev

_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
bryce hendrix | 1 Jun 20:52

Re: Bug with id and minimized window

Changeset 23693.

https://svn.enthought.com/enthought/changeset/23693

Bryce

Will Lee wrote:
> Thanks for the quick response.  Can you tell me what change set it is?
>
> Will
>
> On Fri, May 29, 2009 at 2:08 PM, bryce hendrix <bhendrix@... 
> <mailto:bhendrix@...>> wrote:
>
>     Will Lee wrote:
>     > I've searched on-line but I couldn't find any info on this issue.
>     >
>     > Essentially, I have a traits view that uses an the "id"
>     attribute that
>     > saves the dimension of the window.  However, if I close the window
>     > when it's minimized in Windows XP, it'll set the size of such window
>     > to 0 such that opening the same app next time will not restore the
>     > size properly.  My users are very frustrated with this behavior
>     since
>     > it looks like the application has disappeared and you can only
>     > maximize and minimize it.
>
>     Will, I've made a change to TraitsBackendWX in svn, though I lack a
>     Windows box to test this fix on. If you can test it & let me know
>     if it
>     worked, that would be great, otherwise I'll test my fix later tonight.
>
>     Bryce
>     _______________________________________________
>     Enthought-dev mailing list
>     Enthought-dev@...
>     <mailto:Enthought-dev@...>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Enthought-dev mailing list
> Enthought-dev@...
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>   
Erik Tollerud | 2 Jun 01:30
Picon
Gravatar

[mayavi] Moving Camera (not just panning)

Is there a way to move the camera forward and backward in a mayavi or
tvtk window?  I know I could look at the camera object and translate
the focal point by some mutiple of the view plane normal (with a fixed
sitance), but I'm wondering if there's a function that does this
automatically, or (better yet) if there's some interactive keyboard
command or magic set of motions I can do with the mouse.  I know I can
pan by holding down the middle mouse button, but I can't find any way
to move the focal point in sync with the motion of the camera...
David Warde-Farley | 2 Jun 02:38
Picon
Favicon
Gravatar

Code-checkers & ETS packages

Hi,

I've noticed that pylint, in particular, has a lot of trouble with  
Traits and other Enthought packages (saw this with Chaco as well).

No config file found, using default configuration
************* Module new_tools
E: 14: No name 'traits' in module 'enthought'
F: 14: Unable to import 'enthought.traits.api' (No module named traits)
E: 15: No name 'traits' in module 'enthought'
F: 15: Unable to import 'enthought.traits.api' (No module named traits)
E: 16: No name 'traits' in module 'enthought'
F: 16: Unable to import 'enthought.traits.api' (No module named traits)
E: 23: No name 'traits' in module 'enthought'
F: 23: Unable to import 'enthought.traits.ui.api' (No module named  
traits)
E: 26: No name 'traits' in module 'enthought'
F: 26: Unable to import 'enthought.traits.ui.api' (No module named  
traits)

Importing with the same python interpreter works fine. Is there  
something broken in the top-level package enthought? I easy_install'd  
Traits not too long ago.

Any suggestions on other code-checking utilities would be helpful as  
well.

Regards,

David
Robert Kern | 2 Jun 02:42
Gravatar

Re: Code-checkers & ETS packages

On Mon, Jun 1, 2009 at 19:38, David Warde-Farley <dwf@...> wrote:
> Hi,
>
> I've noticed that pylint, in particular, has a lot of trouble with
> Traits and other Enthought packages (saw this with Chaco as well).
>
> No config file found, using default configuration
> ************* Module new_tools
> E: 14: No name 'traits' in module 'enthought'
> F: 14: Unable to import 'enthought.traits.api' (No module named traits)
> E: 15: No name 'traits' in module 'enthought'
> F: 15: Unable to import 'enthought.traits.api' (No module named traits)
> E: 16: No name 'traits' in module 'enthought'
> F: 16: Unable to import 'enthought.traits.api' (No module named traits)
> E: 23: No name 'traits' in module 'enthought'
> F: 23: Unable to import 'enthought.traits.ui.api' (No module named
> traits)
> E: 26: No name 'traits' in module 'enthought'
> F: 26: Unable to import 'enthought.traits.ui.api' (No module named
> traits)
>
> Importing with the same python interpreter works fine. Is there
> something broken in the top-level package enthought?

No. I'm guessing that pylint doesn't know how to deal with namespace packages.

> I easy_install'd
> Traits not too long ago.
>
> Any suggestions on other code-checking utilities would be helpful as
> well.

I use pyflakes compulsively. It doesn't do nearly as much as pylint,
but it is so fast, I can do it on nearly every file-save.

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
Stephan Gerhard | 2 Jun 08:45
Picon

mri.py example

Hi there!

I wanted to run the mri.py example (from Mayavi 3.2.1) with my 3.1.0
version. But does not seem to work. After invoking, I get a window: TVTK
class chooser, and when I choose e.g. "ImageGaussianSmooth", it says
"Invalid filter chosen! Try again!" and the stops with:

"enthought.traits.trait_errors.TraitError: The 'filter' trait of an
UserDefined instance must be an Object, but a value of None <type
'NoneType'> was specified."

Could anybody tell me what I am missing or do wrong?

Best,
 Stephan

Gmane