From: Mjolnir Date: Tue, 18 Aug 2015 13:01:01 +0000 (+0200) Subject: fix Tool movement X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=bdb006fc22fb87e6ba00bc1d79098ceda517e7a1;p=livingdesktop.git fix Tool movement --- diff --git a/Library/LivingDesktopLibrary.pro b/Library/LivingDesktopLibrary.pro index ee75eb3..af9b885 100644 --- a/Library/LivingDesktopLibrary.pro +++ b/Library/LivingDesktopLibrary.pro @@ -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 diff --git a/Library/XYPlotter.cpp b/Library/XYPlotter.cpp index b8bcc75..2853692 100644 --- a/Library/XYPlotter.cpp +++ b/Library/XYPlotter.cpp @@ -2,6 +2,8 @@ #include +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; diff --git a/Library/XYPlotter.h b/Library/XYPlotter.h index 521928a..6031550 100644 --- a/Library/XYPlotter.h +++ b/Library/XYPlotter.h @@ -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 index ee03a32..0000000 --- a/Library/livingdesktoplibrary.cpp +++ /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 index 4eab60e..0000000 --- a/Library/livingdesktoplibrary.h +++ /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