Skip to content

Commit a266da6

Browse files
ndilietoeyal0
authored andcommitted
Fix autoleveller output format
The %s format sometimes produces invalid g-code as small numbers are converted to exponential form. In addition larger numbers are truncated. Therefore change the format to %.5f which, as an example, outputs > o1 call [0.00003] [13.26319] [-0.08000] instead of > o1 call [2.54e-05] [13.2632] [-0.08] Signed-off-by: Nicola Di Lieto <nicola.dilieto@gmail.com>
1 parent ed67bef commit a266da6

14 files changed

Lines changed: 7869 additions & 7869 deletions

File tree

autoleveller.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ autoleveller::autoleveller( const boost::program_options::variables_map &options
9393
initialYOffsetVar( globalVars->getUniqueCode() ),
9494
ocodes( ocodes )
9595
{
96-
callSub2[Software::LINUXCNC] = "o%1$s call [%2$s] [%3$s] [%4$s]\n";
97-
callSub2[Software::MACH4] = "G65 P%1$s A%2$s B%3$s C%4$s\n";
98-
callSub2[Software::MACH3] = "#" + globalVar0 + "=%2$s\n%5$s#" + globalVar1 + "=%3$s\n%6$s#" + globalVar2 + "=%4$s\n%7$sM98 P%1$s\n";
96+
callSub2[Software::LINUXCNC] = "o%1$s call [%2$.5f] [%3$.5f] [%4$.5f]\n";
97+
callSub2[Software::MACH4] = "G65 P%1$s A%2$.5f B%3$.5f C%4$.5f\n";
98+
callSub2[Software::MACH3] = "#" + globalVar0 + "=%2$.5f\n%5$s#" + globalVar1 + "=%3$.5f\n%6$s#" + globalVar2 + "=%4$.5f\n%7$sM98 P%1$s\n";
9999
}
100100

101101
string autoleveller::getVarName(unsigned int i, unsigned int j) {

0 commit comments

Comments
 (0)