octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave GUI (during break from handle graphics)


From: jswensen
Subject: Octave GUI (during break from handle graphics)
Date: Thu, 25 Aug 2005 23:48:02 -0600
User-agent: Internet Messaging Program (IMP) H3 (4.0.2) / FreeBSD-4.10

I needed a break from working on the handle graphics, so I decided to take a
crack at a UI.  It is rudimentary and simple, but it works.  Basically, I am
using the GTK vte teminal emulator widget to run octave in.  I have a UI thread
that opens a socket and listens for data coming from Octave.  When I start
octave, I have it run an OCT file which spawns a thread and periodically sends
updates to the UI thread.
The data is currently sent as ASCII text in the following fornat:
BEGINVARS
a,1x10,80,matrix,
b,10x10,800,matrix,
ENDVARS
BEGINHIST
b=1:10;
c=b*a;
ENDHIST
I could optimize to send only the most recent history and variables changes.  I
also probably ought to send past history at startup (in order to be more like
the *other* flavor).

A screenshot can be found at the following link.
http://swenmac.homeip.net:8080/OctaveUI.png

I do have a few questions though:
Is there a variable somewhere I can monitor in order to keep from reading the
symbol table while a command is executing?  ( I shamelessly robbed code from
'who' and the functions it calls to build up the list of variables)  I haven't
seen any corrupt data yet (maybe there is symbol table protection in the guts
of octave already?) but it may just be that I have been lucky so far.

Is the actual data stored in the symbol table, or could I send a copy of the
whole symbol table over the socket and let the UI decide what it wants to
display?

FYI, I did a comparison of the Octave2.m benchmark from sciview.org both in a
plain terminal window and in the terminal in the UI to see if the UI caused any
performance hits.  The difference was fairly nominal.  These values were the
biggest differences between seveeral runs of both.

FROM TERMINAL
------------------------
Total time for all 15 tests_________________________ (sec): 8.306
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.2923


FROM UI
--------------
Total time for all 15 tests_________________________ (sec): 8.477
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.2996

FYI #2, as to my handle graphics implementation, I split it into a DOC and VIEW
portion.  I am currently working on getting the DOC portion completely done. 
Then I will continue work on the VIEW portion using gtkmm.  The interfaces
between DOC and VIEW are as follows:
DOC to VIEW
-----------
view_set( handleId, Property )
view_new_handle( type, handleId )
view_delete_handle( handleId )
view_set_doc_handlers( funcptrs to VIEW to DOC handlers )  // this allows
switching of UI toolkits at runtime

VIEW to DOC
------------
doc_set( handleId, Property )  // used for things like window size changed
doc_callback( handleId, callback_type, data ) // used for things like button
clicks
doc_delete_handle( handleId )  // used for thing like closing windows

John Swensen

----------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]