Generating "real-time" 2D line plots in Windows 2k?

T

Todd Gardner

Hello everyone,

I need to use the voice dictation software Dragon NaturallySpeaking
for Windows 2000. I have not yet found a reasonable Linux
alternative.

I need to create and display "real-time" 2D line plots from within my
Ruby application.

I cannot figure out how to make a real-time plots SVG::Graph
http://www.germane-software.com/software/SVG/SVG::Graph/doc/ in my
Ruby application.

I cannot figure out how to install ROOT http://root.cern.ch/ on
Windows 2000 and it seems to be way too comprehensive of a package.

I have been unable to successfully install RMagick
http://studio.imagemagick.org/RMagick/doc/ on Windows 2000.

The R-Project http://www.r-project.org/ seems to be only for
statistical computing but I haven't seen how to install that on
Windows 2000 either.

I cannot figure out how to install the Ruby Graph Library (RGL)
http://www.hduchene.de/ruby/rgl/doc/ on Windows 2000.

I cannot figure out how to install the ruby-libplot
http://www2s.biglobe.ne.jp/~Nori/ruby/ on Windows 2000.\

This is just a small sampling of what I have tried.

I am up for any suggestions and it will be greatly appreciated!

Domo Arigato,

Todd
 
R

Rich

Have you tried the FXCanvas in FXRuby?

I have no idea if you'll get it to do what you need

If that gives you problems, it's not hard at all to draw lines in the
FXGLCanvas, it would just seem like overkill to draw a 2d graph in OpenGL.

FXRuby comes standard in the one-click prag-prog installer for Windows.

-Richard

----- Original Message -----
From: "Todd Gardner" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Thursday, June 17, 2004 5:13 PM
Subject: Generating "real-time" 2D line plots in Windows 2k?
 
T

Tim Bates

Todd said:
I need to use the voice dictation software Dragon NaturallySpeaking
for Windows 2000. I have not yet found a reasonable Linux
alternative.

Heh. Pre-emptively fending off the "switch to Linux!" calls. I like it.
I need to create and display "real-time" 2D line plots from within my
Ruby application.

Although I haven't used it with Windows, I'm assured that the Simple
Directmedia Layer (SDL) is quite portable, and its Ruby bindings in the
form of RUDL are very good.

Tim.
 
D

David Ross

IBM ViaVoice for Linux is pretty good. Haven't used it in a long time. I think
its IBM VisVoice.. came with Mandrake package. --David Ross
 
R

Rich

Here's code that generates a 'real-time' 2d pseudo bar chart (it wouldn't be
that hard to generate a line graph instead).

http://lithinos.com/fxruby_tutorials/moving_graph_short.html

I could show you how to package it so that it acted like a standalone
Windows 2000 EXE if you wanted.

-Richard


----- Original Message -----
From: "Todd Gardner" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Thursday, June 17, 2004 5:13 PM
Subject: Generating "real-time" 2D line plots in Windows 2k?
 
T

Todd Gardner

Rich said:
Here's code that generates a 'real-time' 2d pseudo bar chart (it wouldn't be
that hard to generate a line graph instead).

http://lithinos.com/fxruby_tutorials/moving_graph_short.html

I could show you how to package it so that it acted like a standalone
Windows 2000 EXE if you wanted.

-Richard


----- Original Message -----
From: "Todd Gardner" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Thursday, June 17, 2004 5:13 PM
Subject: Generating "real-time" 2D line plots in Windows 2k?

Hello Richard,

I first must apologize. I am using the voice dictation software
Dragon NaturallySpeaking are Windows 2000 and it sometimes gets things
correct however, sometimes when it messes up messes up big-time and I
just don't notice all of the completely erroneous words.

I am unable to access http://lithinos.com/ so the subsequent link does
not work.

I had downloaded fox-1.2.4 but I am unsure how to use it with Windows.
Would you mind getting this newbie pointers so that I can get this
installed properly?

Also, I would really appreciate it if you show me how to build that
example to an executable.

Any ideas would be greatly appreciated,

Thank you,

Todd
 
R

Rich

----- Original Message -----
From: "Todd Gardner" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Friday, June 18, 2004 7:23 PM
Subject: Re: Generating "real-time" 2D line plots in Windows 2k?
I first must apologize. I am using the voice dictation software

Don't worry.
Dragon NaturallySpeaking are Windows 2000 and it sometimes gets things
correct however, sometimes when it messes up messes up big-time and I
just don't notice all of the completely erroneous words.

lol - I mess up and I'm typing!!
I am unable to access http://lithinos.com/ so the subsequent link does
not work.

Yeah - it's not the greatest hosting company... lots of downtime.
I had downloaded fox-1.2.4 but I am unsure how to use it with Windows.
Would you mind getting this newbie pointers so that I can get this
installed properly?

I wouldn't do it that way. I'd get the one-click installer - it has
everything you'll need for FOX and FXRuby.

The one-click installer is at:

http://rubyforge.org/frs/?group_id=167

Download that, and run it to get everything setup.

After you have that going, just save the following code into a file (".rb")
and double-click it.

START CODE
require 'fox'
include Fox

@appRef=FXApp.new
@mainwin=FXMainWindow.new(@appRef,"Moving
Graph",nil,nil,LAYOUT_FIX_HEIGHT|LAYOUT_FIX_WIDTH|DECOR_ALL)
@[email protected]=200
@mainwin.width=300
@mainwin.height=300
def paint(n,l,d)
if(@first.nil?)
@repaint_n=n
@repaint_l=l
@repaint_d=d
end
FXDCWindow.new(@canvas, d) do |dc|
dc.foreground = @canvas.backColor
dc.fillRectangle(d.rect.x, d.rect.y, d.rect.w, d.rect.h)
end
end
def clear_canvas
FXDCWindow.new(@canvas) do |dc|
dc.foreground = @canvas.backColor
dc.fillRectangle(0, 0, @canvas.width, @canvas.height)
end
end
def draw_graph
clear_canvas
FXDCWindow.new(@canvas) do |dc|
dc.foreground=FXRGB(115,0,0)
x=0
@points.each{|i|
[email protected]
dc.drawLine(x,h,x,h-i)
x+=1
}
end
end
def create_next_value(n,l,d)
if([email protected]?)
1.times do
@[email protected]_s
sleep(1)
@points.shift
[email protected]
if(rand(10)>=5)
new_value=l+rand(10)
new_value=200 if new_value>200
new_value=25 if new_value<0
@points << new_value
else
new_value=l-rand(10)
new_value=200 if new_value>200
new_value=25 if new_value<0
@points << new_value
end
end
else
@firstTime=true
(@canvas.width-2).times do |i|
[email protected]
if(rand(10)>=5)
new_value=l+rand(10)
new_value=200 if new_value>200
new_value=25 if new_value<0
@points << new_value
else
new_value=l-rand(10)
new_value=200 if new_value>200
new_value=25 if new_value<0
@points << new_value
end
end
end
draw_graph
@appRef.addTimeout(1, method:)create_next_value))
end
@show_next_value=FXTextField.new(@mainwin,20,nil,0,LAYOUT_FILL_X|TEXTFIELD_N
ORMAL)
@canvas=FXCanvas.new(@mainwin,nil,0,FRAME_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y
)
@canvas.connect(SEL_PAINT,method:)paint))
@points=[100]

@appRef.addTimeout(1, method:)create_next_value))

@appRef.create
@mainwin.show(PLACEMENT_SCREEN)
@appRef.run
END CODE

That's just an example that I whipped up for you. You'll probably want to do
a bit more with your GUI.
Also, I would really appreciate it if you show me how to build that
example to an executable.

After we get the above stuff working, I'd be happy to walk you through it -
it's super easy.

Remember though - you're not really 'building' it into an executable...
you're packaging the Ruby source file with the Ruby interpreter and FOX
library, and distributing everything in a single file with an EXE extension
that can be double-clicked to run.

It will look and function the same as a 'compiled' or 'built' EXE, but it
isn't really...
Any ideas would be greatly appreciated,

Thank you,

Todd

Not a problem!

-Richard
 
T

Todd Gardner

Hello Richard,

WOW! Thanks your code I am finally able to create and display a graph
close to what I would like in Windows 2000! I am very interested in
seeing how to distribute this as an executable. I have been trying to
use rubyscript2exe-0.1.15.rb however, unsuccessfully.

Any comments would be greatly appreciated!

Thank you,

Todd
 
R

Rich

----- Original Message -----
From: "Todd Gardner" <[email protected]>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <[email protected]>
Sent: Saturday, June 19, 2004 12:53 AM
Subject: Re: Generating "real-time" 2D line plots in Windows 2k?
Hello Richard,

WOW! Thanks your code I am finally able to create and display a graph
close to what I would like in Windows 2000! I am very interested in
seeing how to distribute this as an executable. I have been trying to
use rubyscript2exe-0.1.15.rb however, unsuccessfully.

Download and install Exerb. I think it's at:

http://raa.ruby-lang.org/project/exerb/

... installation is super simple - just follow the README.en.rd file

After that, you'll want to get EZExerb (a GUI I made for exerb).

The link to download that should be:

http://raa.ruby-lang.org/project/ezexerb/

It's an installer for a packaged EXE that helps you in packaging other Ruby
scripts.

Let me know if you have any other questions.

-Richard
 
L

Lothar Scholz

Hello Rich,

R> I really like the fact that you didn't push Ruby.

But maybe mentioning Ruby at least once would be nice.
The word "Ruby" was only used by the interviewer, not by Dave or Andy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top