jrStepGUI

28 views
Skip to first unread message

Reza Naima

unread,
Feb 8, 2011, 3:58:15 AM2/8/11
to rstep
So I finally got the ide working. I needed to install the 64bit version
of the JDE, then eclipse started working. I couldn't get the subversion
to work (no subversion in that list) so I just used my desktop
subversion client to download the files. I had to grab a 64-bit version
of the rxtx dll from the arduino build, and that worked. The code
compiles and I can communicate with the hardware.

There is a ton of code in there. I'm simultaneously impressed and
baffled at the required complexity.

I want to start working on integrating a gcode-interpreter inside
jrStepGUI so I can start doing 3d-visualizations. Where should I begin?

Reza

iklln6

unread,
Feb 8, 2011, 4:03:05 AM2/8/11
to rstep
class modelGCODE{
public:
//TODO write gcode parser and 3d modelling
};

extern modelGCODE;


half way there

Reza Naima

unread,
Feb 8, 2011, 4:06:17 AM2/8/11
to rs...@googlegroups.com
:)

So the configure button still doesn't work.  I'm not sure how eventbus works, but it seems like your looking for these patterns

    EventBus.subscribe(Pattern.compile("RStep Step by inch:.*"), this);
        EventBus.subscribe(Pattern.compile("RStep Feed rate:.*"), this);
        EventBus.subscribe(Pattern.compile("RStep Current:.*"), this);
        EventBus.subscribe(Pattern.compile("RStep Stepping:.*"), this)

however, this is the output

.964]     MSG SBI(4064,4064,4064)
[16:10:15.980]     MSG MFR(15,15,13)
[16:10:16.012]     MSG Cur(2.00,2.00,2.00)
[16:10:16.028]     MSG Step(16)
[16:10:16.044]     MSG Abs(1)


and this is what i see..



thoughts?
-reza



iklln6
Tuesday, February 08, 2011 1:03 AM

class modelGCODE{
public:
//TODO write gcode parser and 3d modelling
};

extern modelGCODE;


half way there



Reza Naima
Tuesday, February 08, 2011 12:58 AM

jlp

unread,
Feb 8, 2011, 8:20:41 AM2/8/11
to rstep
You need the subversive eclipse plugin to have the subversion
features.
Take a look at the WiKi to have detailed instructions or go to Help >
Install New Software... and paste http://download.eclipse.org/technology/subversive/0.7/update-site/
in the Work with: box. The rest is quite easy.

The code under com.studionex.rStep is the low level communication code
with the serial handler (over RXTX) and the input parser. This code
produces events and exceptions which should be catched by a user
program.

The code under com.studionex.jrStepGUI.rStep is an higher level
wrapper the low level rStep code. This wrapper catches the events and
exceptions and turn them into EventBus messages. The higher level
wrapper also provides some gcode file playback and a way to process
multiple gcodes on a single input line.
The advantage of the EventBus over the classic event/exception scheme
is a loose coupling of the classes (less interfaces and abstract types
to write at the end).

The classes under com.studionex.jrStepGUI are mostly UI elements. It
is possible to mix them in one large application class but I prefer to
keep them separated to have a clearer view.

com.studionex.misc.ui and com.studionex.event are tool packages.

On 8 fév, 09:58, Reza Naima <r...@rez

jlp

unread,
Feb 8, 2011, 8:42:02 AM2/8/11
to rstep
1. The low level: The text sent by rStep (MSG SBI... ) is processed in
com.studionex.rStep.input.InputParser and sent as events by
com.studionex.rStep.RStep. The events are data structures parsed from
the text (SBI messages are stored in
com.studionex.rStep.input.StepByInchMessageEvent instances).

2. The high level: These events are catched by
com.studionex.jrStepGUI.rStep.RStep in the eventHandler(InputEvent
inputEvent) method and wrapped into EventBus messages which "topic" is
formed by "RStep " + the string representation of the event.

3. How to use it: In any class you want some information about the
rStep output, you just have to register the appropriate event of the
EventBus. e.g. in the HardwareConfigJDialog class (the configuration
dialog) you have to write EventBus.subscribe(Pattern.compile("RStep
Step by inch:.*"), this) which register the current instance (this) to
receive all the messages following the "RStep Step by inch:.*"
pattern.

See http://code.google.com/p/rstep/source/browse/trunk/clients/jrStepGUI/doc/Message%20Passing.txt
to have a summary of all the messages published on the EventBus and
where they are listened to.

On 8 fév, 10:06, Reza Naima <r...@reza.net> wrote:
> :)
>
> So the configure button still doesn't work.  I'm not sure how eventbus
> works, but it seems like your looking for these patterns
>
>      EventBus.subscribe(Pattern.compile("RStep Step by inch:.*"), this);
>          EventBus.subscribe(Pattern.compile("RStep Feed rate:.*"), this);
>          EventBus.subscribe(Pattern.compile("RStep Current:.*"), this);
>          EventBus.subscribe(Pattern.compile("RStep Stepping:.*"), this)
>
> however, this is the output
>
> .964]     MSG SBI(4064,4064,4064)
> [16:10:15.980]     MSG MFR(15,15,13)
> [16:10:16.012]     MSG Cur(2.00,2.00,2.00)
> [16:10:16.028]     MSG Step(16)
> [16:10:16.044]     MSG Abs(1)
>
> and this is what i see..
>
> thoughts?
> -reza
>
> > ------------------------------------------------------------------------
>
> >    iklln6 <mailto:michaeldn...@gmail.com>
> > Tuesday, February 08, 2011 1:03 AM
>
> > class modelGCODE{
> > public:
> > //TODO write gcode parser and 3d modelling
> > };
>
> > extern modelGCODE;
>
> > half way there
>
> > ------------------------------------------------------------------------
>
> >    Reza Naima <mailto:r...@reza.net>

jlp

unread,
Feb 8, 2011, 9:33:56 AM2/8/11
to rstep
May I suggest something different ;)

imho the simplest way to write a 2D or 3D rendering of what rStep does
is to process the coordinates messages (be sure to have defined
REPORT_DELAY in _init.h)...

EventBus.subscribe(Pattern.compile("RStep Coordinates:.*"), this);

... and write the event handler:

public void onEvent(String topic, CoordinatesMessageEvent data) {

// some smart rendering:
System.out.println("mill is at " + data.getX() + " " + data.getY() +
" " + data.getZ());

}


This way you'll avoid to write another gcode interpreter and you stay
in sync with rStep.

If you want to add the graphic rendering in the tabs, you'll have to
add in ConsoleJTabbedPane a line like: addTab("Graphics",
myJPanelInstance) (if your graphic renderer is a JPanel).
Reply all
Reply to author
Forward
0 new messages