On Fri, Dec 17, 2010 at 03:42:43PM +0100, Michael B?sch wrote:
> On Fri, 2010-12-17 at 08:22 +0000, Chris Morley wrote:
> >         --- a/src/emc/rs274ngc/interp_convert.cc
> >         +++ b/src/emc/rs274ngc/interp_convert.cc
> >         @@ -2915,6 +2915,9 @@ int Interp::convert_modal_0(int
> >         code,    //!< G code, must be from group 0
> >                if(block->l_number == 1 || block->l_number == 10 ||
> >         block->l_number == 11)
> >                    CHP(convert_setup_tool(block, settings));
> >                else
> >         +          if (((int) (block->p_number + 0.0001)) == 0) {
> >         +            block->p_number = settings->origin_index;
> >         +          }
> >                    CHP(convert_setup(block, settings));
> >            } else if ((code == G_28) || (code == G_30)) {
> >              CHP(convert_home(code, block, settings));
> > 
> This breaks the "else" branch.

Aside from that problem, this logic belongs inside convert_setup.
This code's purpose is to just call the right convert_* function.

You should probably not actually change block->p_number; none of the
existing code works that way.  Just handle it being zero inside
convert_setup.

For symmetry's sake, how do you feel about doing the same with
convert_setup_tool?  It is just as likely that someone wants to set a
tool length as a G5x offset this way, I think.  I am not sure if a
random tool change machine can set a length on tool zero currently -
if so, we've got a problem.  Maybe in that case, -1 would be the
magic number you should use (for both)?

I like the idea - thanks for working on this.

Chris

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to