Advice Needed on PHP Capabilities

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jeff_Tebo
Forum Newbie
Posts: 2
Joined: Fri May 09, 2003 9:57 pm
Location: Victoria BC

Advice Needed on PHP Capabilities

Post 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
User avatar
voodoo9055
Forum Commoner
Posts: 51
Joined: Sat Apr 26, 2003 3:27 pm
Location: Montgomery, AL

Post by voodoo9055 »

Wow
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

my thoughts exactally.


:o
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post 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!
Jeff_Tebo
Forum Newbie
Posts: 2
Joined: Fri May 09, 2003 9:57 pm
Location: Victoria BC

Wow...

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post 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.
Post Reply