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 Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers