fix round to use float not double
authorJim Morris <morris@wolfman.com>
Sun, 18 Jan 2015 06:48:37 +0000 (22:48 -0800)
committerJim Morris <morris@wolfman.com>
Sun, 18 Jan 2015 06:48:37 +0000 (22:48 -0800)
M504 should use appendfilestream as well

src/modules/robot/arm_solutions/LinearDeltaSolution.cpp
src/modules/utils/simpleshell/SimpleShell.cpp

index 2ce55e6..a67ee39 100644 (file)
@@ -14,7 +14,7 @@
 
 
 #define SQ(x) powf(x, 2)
-#define ROUND(x, y) (roundf(x * 1e ## y) / 1e ## y)
+#define ROUND(x, y) (roundf(x * (float)(1e ## y)) / (float)(1e ## y))
 
 LinearDeltaSolution::LinearDeltaSolution(Config* config)
 {
index 3f8275e..f8aeb11 100644 (file)
@@ -17,6 +17,7 @@
 #include "mri.h"
 #include "version.h"
 #include "PublicDataRequest.h"
+#include "AppendFileStream.h"
 #include "FileStream.h"
 #include "checksumm.h"
 #include "PublicData.h"
@@ -445,11 +446,11 @@ void SimpleShell::save_command( string parameters, StreamOutput *stream )
     }
 
     // replace stream with one that writes to config-override file
-    FileStream *gs = new FileStream(filename.c_str());
-    if(!gs->is_open()) {
-        stream->printf("Unable to open File %s for write\n", filename.c_str());
-        return;
-    }
+    AppendFileStream *gs = new AppendFileStream(filename.c_str());
+    // if(!gs->is_open()) {
+    //     stream->printf("Unable to open File %s for write\n", filename.c_str());
+    //     return;
+    // }
 
     // issue a M500 which will store values in the file stream
     Gcode *gcode = new Gcode("M500", gs);