Octave GUI (during break from handle graphics)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Octave GUI (during break from handle graphics)

jswensen
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 | Threaded
Open this post in threaded view
|

Re: Octave GUI (during break from handle graphics)

Jonathan Stickel
[hidden email] wrote:
> 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.
>
<snip>
> A screenshot can be found at the following link.
> http://swenmac.homeip.net:8080/OctaveUI.png
>

Hey, this looks great!  I will use it as soon as you can release
something stable.  One feature I especially used in the Matlab gui was
copying and pasting from the 'command history' window into the terminal.
  Does your implementation support this?

Jonathan

Reply | Threaded
Open this post in threaded view
|

Re: Octave GUI (during break from handle graphics)

jswensen
Quoting Jonathan Stickel <[hidden email]>:

> [hidden email] wrote:
>> 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.
> <snip>
>> A screenshot can be found at the following link.
>> http://swenmac.homeip.net:8080/OctaveUI.png
>>
>
> Hey, this looks great!  I will use it as soon as you can release
> something stable.  One feature I especially used in the Matlab gui
> was copying and pasting from the 'command history' window into the
> terminal.  Does your implementation support this?
>
> Jonathan
>

It doesn't support it yet, but it will very soon.  Is is simply a matter of
implementing a couple of UI signal handlers and the VTE Terminal
Emulator makes
it really easy to send commands to the terminal.

I'm also going to work tonight on getting it to compile with the Win32 Native
gtkmm/gtk+ rather than the Cygwin/X version.

John

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