fix Tool movement
authorMjolnir <thomas.pietrzak@inria.fr>
Tue, 18 Aug 2015 13:01:01 +0000 (15:01 +0200)
committerMjolnir <thomas.pietrzak@inria.fr>
Tue, 18 Aug 2015 13:01:01 +0000 (15:01 +0200)
Library/LivingDesktopLibrary.pro
Library/XYPlotter.cpp
Library/XYPlotter.h
Library/livingdesktoplibrary.cpp [deleted file]
Library/livingdesktoplibrary.h [deleted file]

index ee75eb3f65f768dd053c4d4d70a91acbdf48954e..af9b885ae2bd6be7f37c69959980c9badcce4caa 100644 (file)
@@ -11,14 +11,14 @@ TEMPLATE = lib
 
 DEFINES += LIVINGDESKTOPLIBRARY_LIBRARY
 
-SOURCES += livingdesktoplibrary.cpp\
-    ErrorMessage.cpp \
-    XYPlotter.cpp
+SOURCES +=\
+        ErrorMessage.cpp \
+        XYPlotter.cpp
 
-HEADERS += livingdesktoplibrary.h\
+HEADERS +=\
         livingdesktoplibrary_global.h\
-    ErrorMessage.h \
-    XYPlotter.h
+        ErrorMessage.h \
+        XYPlotter.h
 
 unix {
     target.path = /usr/lib
index b8bcc75b4f1f9b0178bf3e8529b65078e9eb26b0..2853692e62c988982f377bb35f32032b3f939255 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <QString>
 
+const int XYPlotter::toolDistance = 70;
+
 XYPlotter::XYPlotter(QString port)
 : serialPort(new QSerialPort(port)), connected(false), posX(0), posY(0), toolUp(false)
 {
@@ -27,7 +29,7 @@ void XYPlotter::moveTo(unsigned int x, unsigned int y, bool toolup=true)
     {
         QString buffer = "G01X" + QString::number(x) +
                 "Y" + QString::number(y) +
-                "Z" + QString::number(toolup) +
+                "Z" + QString::number(toolup * toolDistance) +
                 "F50000\n";
         serialPort->write(buffer.toStdString().data(), strlen(buffer.toStdString().data()));
         posX = x;
index 521928a9ff23a8151b5f33e1a5fdc1ebb64a3f77..603155089c881dbb802a6c8e1449384767613e7d 100644 (file)
@@ -20,6 +20,8 @@ class LIVINGDESKTOPLIBRARYSHARED_EXPORT XYPlotter
 
         unsigned int posX, posY;
         bool toolUp;
+
+        static const int toolDistance;
 };
 
 #endif // XYPLOTTER_H
diff --git a/Library/livingdesktoplibrary.cpp b/Library/livingdesktoplibrary.cpp
deleted file mode 100644 (file)
index ee03a32..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "livingdesktoplibrary.h"
-
-LivingDesktopLibrary::LivingDesktopLibrary()
-{
-}
diff --git a/Library/livingdesktoplibrary.h b/Library/livingdesktoplibrary.h
deleted file mode 100644 (file)
index 4eab60e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef LIVINGDESKTOPLIBRARY_H
-#define LIVINGDESKTOPLIBRARY_H
-
-#include "livingdesktoplibrary_global.h"
-
-class LIVINGDESKTOPLIBRARYSHARED_EXPORT LivingDesktopLibrary
-{
-
-    public:
-        LivingDesktopLibrary();
-};
-
-#endif // LIVINGDESKTOPLIBRARY_H