"^CeFoS^" <se****@terra.es> wrote in message
news:74**************************@posting.google.c om...
still waiting...
Hello to everybody,
I've done an application that draws in a frame the trajectory
of a robot. The robot position is read through the serial port,
and several commands are written through the same port to
change the direction of the robot.
The trajectory frame is managed by an applet, and the
project works good when the applet is called by a html
document allocated in the same local machine under W98
where the classes and the serial port are.
Am I to understand that all the pertinent application logic:
* Robot Interface / Control [i.e. serial port access, generate
robot commands (?) etc]
* Trajectory Engine [i.e. trajectory data generation etc]
* User Interface [i.e. frame management, trajectory data
display, user command interpretation etc]
is located within the applet ? If so, I suggest a design change - see
response below.
But my intention is now that the serial port is going to
be in a server machine under Linux, and the users will
connect with the frame through internet. And these are the
questions:
1.- If the same application that works in a local machine is
called by these users, will it operate with the serial port of the
server or the serial port of the user PC?
If you are executing code on machine X which accesses the serial port [or
any other resource / device] it will be machine X's serial port / device it
will be accessing. Thus, in this case, the user PC's port. To put it quite
simply, it is not possible to *directly* access another machine's resource /
devices. Such functionality [i.e. access to remote resources] needs the aid
of an intermediary [i.e. URL, socket, RMI, etc], and code needs to be
altered to allow this.
Note:
* Applets [unsigned] loaded via URL cannot access local
resources - forget accessing local PC serial port [it's not
what you want anyway]
2.- With the traditional applets can the users see the trajectory
in the frame with the readed data from the server serial port and
operate through the hmtl document in order to write in the server
serial port?
If you redesign your project you will certainly have the functionality you
require via an URL-launched unsigned applet. One [of several possible]
redesign suggestion:
* Implement a server application, which will execute on
your Linux box, to perform the:
- Robot Interface / Control
- Trajectory Engine
duties. I recommend use of the 'javax.comm' package for
serial port access tasks
* Your applet could be redesigned to do what applets do
best - act as a user interface to a server application. The
applet would communicate with the server application:
- Sending user commands
- Receiving robot trajectory data and drawing it on
screen, etc
I hope this explanation sheds some light on your problem, and please note
that the suggested approach is only one of several. My aim is to offer
ideas, not a complete solution.
Cheers,
Anthony Borla
P.S.
You might care to post to:
comp.lang.java.help
comp.lang.java.programmer
in future. The current newsgroup was officially retired in 1996, which
partly explains why responses come very slowly, if at all.
I've also taken the liberty of forwarding this response to
'comp.lang.java.help' - you may well get additional feedback.