Hagai Tunik <hagai@yours.com> writes:
I am trying to write a HMI for an application I’ve writtten on a non-
Photon environment.
The best tool I’ve found is ncurses.
My problem that all the input functions I use (getch(), wgetch() - with
nodelay(), notimeout()) cause my program to be Reply-block with Dev.
- Has any of you used ncurses for HMI & can give me a hint?
If you put your stdin into raw() mode, and then use select() to
determine whether input is available, then getch() and friends will
not block, at least for the first byte. You can use _select_receive()
with select() to let your application also receive QNX messages and
proxies.
- Perhaps you could recomend a better tool?
MGL version 5 beta works reasonably well in QNX 4. It is a little bit
low-level, but you can create pretty good-looking user interfaces with
it.
If the non-Photon constraint is just because the tool is originally
written outside of Photon, you could try creating a Photon interface
that runs your command-line program in a PTY. Your Photon program
just talks to your program, emittting and parsing strings.
Andrew
Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: andrew@cogent.ca WWW: http://www.cogent.ca