CAD CAM EDM DRO - Yahoo Group Archive

Re: EMC C Code

Posted by shackle@x...
on 1999-06-14 05:59:29 UTC
> From mshaver@... Mon Jun 14 03:26:23 1999
> From: "Matt Shaver" <mshaver@...>
> To: <CAD_CAM_EDM_DRO@onelist.com>
> Date: Mon, 14 Jun 1999 03:24:00 -0400
> X-MSMail-Priority: Normal
> X-Priority: 3
> Mailing-List: list CAD_CAM_EDM_DRO@onelist.com; contact
CAD_CAM_EDM_DRO-owner@onelist.com
> Delivered-To: mailing list CAD_CAM_EDM_DRO@onelist.com
> List-Unsubscribe: <mailto:CAD_CAM_EDM_DRO-unsubscribe@...>
> Mime-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: Re: [CAD_CAM_EDM_DRO] EMC C Code
>
> From: "Matt Shaver" <mshaver@...>
>
> > From: Jon Elson <jmelson@...>
> > Now, the trick is that the Java interface can run on a different
> > computer. But, then, the X-windows interface (Xemc) could run on
> > another computer, too, and it is almost as portable as Java.
>
> Having played with it enough to write this program,
>
> http://www.erols.com/mshaver/emcgui.htm
>
> I'd have to say that the promise of "write once, run anywhere" was
> considerably overstated. It ran great in Applet Viewer. which is the utility
> that comes with Java Development Kit (JDK) you are supposed to use to test
> your applets with. It also, oddly enough, worked great in IE. I've seen it
> run OK in the Windows version of Netscape, but act weird in Netscape on Linux
> and SunOS. The Advanced Windowing Toolkit (AWT) comes with a Button object,
> but it only supports ButtonDown events, not ButtonUp. I need ButtonUp for the
> jog buttons so I had to create a whole new class of button I called
> TextButton that had the features (called methods in Javaspeak) I needed. I
> also never figured out how to add support for keyboard KeyUp/KeyDown events
> which are all but required (I'll bet Jon would be less than enthusiastic
> about a mouse-only GUI for the EMC!).
>
> Matt
>
>

It shouldn't really be called "write once,run anywhere". It should be "
write once, test everywhere, work around the bugs, run anywhere". But I still
think it is easier to get graphical programs written in Java to run on multiple
platfroms than C++ programs. Having xemc run on an NT platform for instance
either requires installing an X server on NT and I don't know of one that's free
or rewriting it to use the Win32 or MFC interfaces which would be almost as bad
as starting from scratch.


To intercept keyboard input.

Add "implements keyListener" to your applet class.
In either init() or the constructor add addKeyListener(this); and three
functions to your applet class.

public void keyPressed(KeyEvent evt)
public void keyReleased(KeyEvent evt)
public void keyTyped(KeyEvent evt)

There is another problem that you need to be aware of. If
you hold down a key for several seconds. Instead of just a single keyPressed
after a few seconds you may get a keyReleased even though you didn't release the
key followed quickly by another keyPressed. Fred solved this in xemc by ignoring
the equivalent of key released for a few milliseconds so you wouldn't get jerky
starts and stops while holding the jog key. I think the same thing would
probably work in Java.

Also, would you mind making the source code publically available?

I think I might modify it to make a few commands and status fields actually
connect to the EMC and repost it hoping someone else would finish the job.

-- Will


> ------------------------------------------------------------------------
> How has ONElist changed your life?
> Share your story with us at http://www.onelist.com
> ------------------------------------------------------------------------
> welcome to CAD_CAM_EDM_DRO@..., an unmodulated list for the discussion
of shop built systems in the above catagories.
> To Unsubscribe:
> http://www.onelist.com/unsubscribe/CAD_CAM_EDM_DRO
> bill, List Manager
>

Discussion Thread

Robert N. Ash 1999-06-12 06:37:05 UTC Re: EMC C Code Jon Elson 1999-06-12 22:27:02 UTC Re: EMC C Code Robert N. Ash 1999-06-13 05:49:33 UTC Re: EMC C Code paul@x... 1999-06-13 09:51:28 UTC Re: EMC C Code Jon Elson 1999-06-13 22:14:04 UTC Re: EMC C Code Jon Elson 1999-06-13 22:51:09 UTC Re: EMC C Code Matt Shaver 1999-06-14 00:24:00 UTC Re: EMC C Code paul@x... 1999-06-14 05:02:00 UTC Re: EMC C Code shackle@x... 1999-06-14 05:59:29 UTC Re: EMC C Code