Page 1 of 1

Advice Needed on PHP Capabilities

Posted: Fri May 09, 2003 9:57 pm
by Jeff_Tebo
The University of Victoria Mechanical Engineering faculty has taken on the challenge of designing a user based output system capable of communicating and actuating household devices with only ocular input.

The non-profit project intends to empower people with restricted movement with a level of autonomy by enhancing their only functional output device, the eye. A camera will interpret eye movements and send data to a computer system in the same fashion as a mouse. The
user will pass over icons and select the desired symbol by blinking. The computer will then provide speech synthesis and device actuation.

I am most familiar with PHP and mySQL. As a mechanical engineer I would much rather stick to what I know. Can PHP or PHP GTK intake information coming from a serial point and use it to describe the motion of a mouse like pointer? Or must I step down into the happy world of C++? Any input or advise would be greatly appreciated.

Best Regards

Posted: Fri May 09, 2003 10:12 pm
by voodoo9055
Wow

Posted: Fri May 09, 2003 10:24 pm
by m3mn0n
my thoughts exactally.


:o

Posted: Fri May 09, 2003 11:39 pm
by AVATAr
im guessing here but php runs only when somebody calls it... for instance when you enter a url or when you schedule some job with cron or something..

so you need a real time program if you want to read from a serial port and send the mouse "clics" to the user page (php in this case)..

You could use php for the input ... (using forms and that kind of stuff).

excellent project!

Wow...

Posted: Tue May 13, 2003 12:26 pm
by Jeff_Tebo
...was our thoughts exactly. Hell, we're all mechanical engineers here. But the fastest way to learn to swim is to jump in the deep end right? What's the worst that could happen? ; )

So to clarify. PHP will provide an excellent user interface backed by mySQL for unlimited databasing goodness. PHP can pass information to other program provided user input triggers the action.

ie. Passes a text string to a text to speech utility which creates, then plays an audio file.

PHP WILL NOT monitor input from an exterior source.

That sum it up adequately?

Thanks for the help.

Best Regards,

Jeff Tebo

Posted: Tue May 13, 2003 3:23 pm
by volka
on many systems devices like the com-port are represented as files that php might read (more or less elegantly, most times more less ;) ).
If you use php/gtk you'll get a gui-system that can be programmed via php. e.g. you define a button that is rendered and handled by gtk. An event that occurs on that button can be passed to a php function. A bit like <button onClick="javascript:handleClick()">press me</button>
wether the capabilities of php+gtk are sufficient for your project is up to you.
You might also run a webserach on tcl/tk, gtk, qt, ...
Those graphics libraries have been adapted to many languages (or the other way round)

Jason also mentioned something about XUL to PHP-GTK, interesting.

Posted: Tue May 13, 2003 8:40 pm
by llimllib
What you're describing may certainly be done with PHP. However, it's (IMHO) a less-than-optimal solution. PHP is intended as a niche web-programming language, and although it can be stretched past this, that is it's purpose.

What I might recommend to you is to check out Python with py-gtk, wxPython, or PyQt to accomplish what you want. You will have a similar language to PHP, very easy to learn (much much much easier than C++, and more beautiful to an engineer's mind :) ) . Python is intended as more of a general-purpose language than PHP.

For example, Red Hat designs some of its configuration tools in py-gtk (or pyGTK, or something like that, I don't know how to write it). It has the advantage of being very developer-friendly, more so than almost any other language, and so it's very quick to develop with. Also, there are many more modules available for Python than there are for PHP, and it's core libraries are better adapted for general-purpose computing. Just my two cents.

p.s.: BDKR will disagree with me, he uses all kinds of PHP for system tasks, so if you decide use PHP for this project you might want to ask him about it.