2nd attempt

   Changes:
   Signed-off
   Solved when a tool table is written by Gcode such as G10
   Corrected indentation for 4 space/tab

   What I still did not do:
   Documentation for the changes. I do not know where the documentation
should be placed. In this email? in a separated file that goes with the
patch?
   If it could be in this email then the documentation would be:
    

2.11. [EMCIO] SECTION

 

   *
/FANUC_TOOLTIP_ORIENTATION = 1/ - If the tool tip orientation to be used
should be equal to all known lathe machines (except linuxcnc)

   My opinion is that when the orientation was created in linuxcnc it was
wrongly "seen" probably due to the back tool lathe. This patch solves the
issue maintaining the internal calculation of linuxcnc and swapping the
tool orientation when the tooltable is read from and write from the
tooltable file.
   If the user does not set FANUC_TOOLTIP_ORIENTATION = 1, or sets to 0,
then no changes result due to this patch.

   Citando Jeff Epler <[email protected]>:
Thank you for offering this patch to improve LinuxCNC.

  I don't know enough about lathes or fanuc gcode to evaluate whether the
  general idea of changing orientation numbers in this way is right or
  wrong.  I hope someone else will be able to do this.  Instead, my notes
  below are all boring technical stuff.

  This patch is not "Signed-Off-By".  Without this special line in a
  commit message, our policy states that we cannot incorporate your change
  into linuxcnc.  See our contributor documentation for what this line
  means and how to add it to your commit message.

  This patch does not add documentation for the new feature.  Without
  documentation, new users cannot discover the functionality for
  themselves.

  However, I don't see what happens to orientation when a tool table file is
  rewritten.  For instance, the value 2 is read from a file and converted
  to 3 in memory.  Later, a gcode such as G10 L10 P1 R[1/8] is executed
  (set radius of tool number 1 to [1/8]) that causes the whole tool table
  to be written.  It appears to me, without testing, that the value 3 will
  be written to the table, which will not have the correct meaning when
  the table is next read in, such as when starting the machine the next
  time.
toolTable[pocket].backangle = backangle;
   +         if (fanuc_tooltip_orientation) {
   +             if (orientation == 2) toolTable[pocket].orientation = 3;
   +                     else if (orientation == 3)
toolTable[pocket].orientation = 2;
   +                             else if (orientation == 6)
toolTable[pocket].orientation = 8;
   +                    else if (orientation == 8)
toolTable[pocket].orientation = 6;
   +                        else if (orientation == 1)
toolTable[pocket].orientation = 4;
   +                            else if (orientation == 4)
toolTable[pocket].orientation = 1;
   +                                else
toolTable[pocket].orientation = orientation;
   +             }
   +         else
                toolTable[pocket].orientation = orientation;
  This indentation is very irregular.  The 'if' shold be indented as much
  as the line above it, and all the lines inside should be indented the
  same, more like this:
     toolTable[pocket].backangle = backangle;
         if (fanuc_tooltip_orientation) {
         if (orientation == 2) toolTable[pocket].orientation = 3;
         else if (orientation == 3) toolTable[pocket].orientation = 2;
         else if (orientation == 6) toolTable[pocket].orientation = 8;
         else if (orientation == 8) toolTable[pocket].orientation = 6;
         else if (orientation == 1) toolTable[pocket].orientation = 4;
         else if (orientation == 4) toolTable[pocket].orientation = 1;
         else toolTable[pocket].orientation = orientation;
     }
     else
         toolTable[pocket].orientation = orientation;

  LinuxCNC's coding style is that tab characters are always displayed as 8
  spaces, but the indentation level is 4 spaces.  Either configure your
  editor to insert 4 spaces when you type tab, or always type 4 spaces
  manually to set indentation.

  Jeff


------------------------------------------------------------------------------
  Transform Data into Opportunity.
  Accelerate data analysis in your applications with
  Intel Data Analytics Acceleration Library.
  Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
  _______________________________________________
  Emc-developers mailing list
[email protected]https://lists.sourceforge.net/lists/listinfo/emc-developers

Attachment: fanuc_tooltip_orientation.patch
Description: Binary data

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to