Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 371 → Rev 372

/Misc Projects/PcMarlinInterface/PasteController.cpp
7,13 → 7,17
xPos = yPos = zPos = 0.0;
X_Incr = X_Decr = Y_Incr = Y_Decr = Z_Incr = Z_Decr = E_Incr = false;
 
transmittingData = false;
queueCmds = new QQueue<QString>();
 
tmrUpdate = new QTimer(this);
connect(tmrUpdate, SIGNAL(timeout()), this, SLOT(UpdatePosition()));
connect(tmrUpdate, SIGNAL(timeout()), this, SLOT(MoveToolhead()));
 
QString helpString = "";
helpString.append("XY Control: Arrow Keys or H/J/K/L\n");
helpString.append("Z Control: PgUp/PgDown\n");
helpString.append("Extruder Control: Space");
helpString.append(" - Hold Shift for Slower Movement\n");
helpString.append("Extruder Trigger: Space");
labelHelp = new QLabel(helpString);
 
QVBoxLayout *helpLayout = new QVBoxLayout();
26,13 → 30,14
connect(btnEnableHotkeys, SIGNAL(clicked()), this, SLOT(ToggleHotkeys()));
 
btnInit = new QPushButton("&Initialize Printer");
connect(btnInit, SIGNAL(clicked()), this, SLOT(InitializePrinter()));
 
btnHome = new QPushButton("&Home Printhead");
connect(btnHome, SIGNAL(clicked()), this, SLOT(ResetPosition()));
 
QVBoxLayout *miscBtnLayout = new QVBoxLayout();
miscBtnLayout->addWidget(btnInit);
miscBtnLayout->addWidget(btnEnableHotkeys);
miscBtnLayout->addWidget(btnInit);
miscBtnLayout->addWidget(btnHome);
 
QGroupBox *miscBtnBox = new QGroupBox("Preset Commands");
52,36 → 57,37
btnForward->setIcon(iconUp);
btnForward->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnForward->setAutoRaise(true);
connect(btnForward, SIGNAL(clicked()), this, SLOT(UpdatePositionSingle()));
connect(btnForward, SIGNAL(clicked()), this, SLOT(MoveToolheadSingle()));
btnBackward = new QToolButton();
btnBackward->setIcon(iconDown);
btnBackward->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnBackward->setAutoRaise(true);
connect(btnBackward, SIGNAL(clicked()), this, SLOT(UpdatePositionSingle()));
connect(btnBackward, SIGNAL(clicked()), this, SLOT(MoveToolheadSingle()));
btnLeft = new QToolButton();
btnLeft->setIcon(iconLeft);
btnLeft->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnLeft->setAutoRaise(true);
connect(btnLeft, SIGNAL(clicked()), this, SLOT(UpdatePositionSingle()));
connect(btnLeft, SIGNAL(clicked()), this, SLOT(MoveToolheadSingle()));
btnRight = new QToolButton();
btnRight->setIcon(iconRight);
btnRight->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnRight->setAutoRaise(true);
connect(btnRight, SIGNAL(clicked()), this, SLOT(UpdatePositionSingle()));
connect(btnRight, SIGNAL(clicked()), this, SLOT(MoveToolheadSingle()));
btnUp = new QToolButton();
btnUp->setIcon(iconAdd);
btnUp->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnUp->setAutoRaise(true);
connect(btnUp, SIGNAL(clicked()), this, SLOT(UpdatePositionSingle()));
connect(btnUp, SIGNAL(clicked()), this, SLOT(MoveToolheadSingle()));
btnDown = new QToolButton();
btnDown->setIcon(iconRemove);
btnDown->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnDown->setAutoRaise(true);
connect(btnDown, SIGNAL(clicked()), this, SLOT(UpdatePositionSingle()));
connect(btnDown, SIGNAL(clicked()), this, SLOT(MoveToolheadSingle()));
btnExtrude = new QToolButton();
btnExtrude->setIcon(iconDelete);
btnExtrude->setIconSize(QSize(BTN_ICON_SIZE,BTN_ICON_SIZE));
btnExtrude->setAutoRaise(true);
connect(btnExtrude, SIGNAL(clicked()), this, SLOT(ExtrudeSingle()));
 
QGridLayout *btnXYELayout = new QGridLayout();
btnXYELayout->addWidget(btnForward, 0, 1, 1, 1);
113,17 → 119,19
textXValue->setMaximumWidth(60);
textXValue->setFont(QFont("", 10, QFont::Bold));
textXValue->setAlignment(Qt::AlignCenter);
textXValue->setText(QString::number(xPos, 'f', 2));
textYValue = new QLineEdit();
textYValue->setReadOnly(true);
textYValue->setMaximumWidth(60);
textYValue->setFont(QFont("", 10, QFont::Bold));
textYValue->setAlignment(Qt::AlignCenter);
textYValue->setText(QString::number(yPos, 'f', 2));
textZValue = new QLineEdit();
textZValue->setReadOnly(true);
textZValue->setMaximumWidth(60);
textZValue->setFont(QFont("", 10, QFont::Bold));
textZValue->setAlignment(Qt::AlignCenter);
UpdatePosition();
textZValue->setText(QString::number(zPos, 'f', 2));
 
QHBoxLayout *posValueLayout = new QHBoxLayout();
posValueLayout->addWidget(labelXPos);
160,7 → 168,7
 
labelEForwardSteps = new QLabel("Extrude Step (mm):");
sliderEForwardSteps = new QSlider(Qt::Horizontal);
textEForwardSteps = new QSpinBox();
textEForwardSteps = new QDoubleSpinBox();
textEForwardSteps->setMinimumWidth(60);
labelEForwardSpeed = new QLabel("Extrude Speed (mm/s):");
sliderEForwardSpeed = new QSlider(Qt::Horizontal);
168,12 → 176,16
textEForwardSpeed->setMinimumWidth(60);
labelEBackwardSteps = new QLabel("Retract Step (mm):");
sliderEBackwardSteps = new QSlider(Qt::Horizontal);
textEBackwardSteps = new QSpinBox();
textEBackwardSteps = new QDoubleSpinBox();
textEBackwardSteps->setMinimumWidth(60);
labelEBackwardSpeed = new QLabel("Retract Speed: (mm/s)");
sliderEBackwardSpeed = new QSlider(Qt::Horizontal);
textEBackwardSpeed = new QSpinBox();
textEBackwardSpeed->setMinimumWidth(60);
labelExtrusionHeight = new QLabel("Extrude Height (mm):");
sliderExtrusionHeight = new QSlider(Qt::Horizontal);
textExtrusionHeight = new QDoubleSpinBox();
textExtrusionHeight->setMinimumWidth(60);
labelEZSteps = new QLabel("Z Axis Step (mm):");
sliderEZSteps = new QSlider(Qt::Horizontal);
textEZSteps = new QDoubleSpinBox();
181,32 → 193,33
 
connect(sliderXYSteps, SIGNAL(valueChanged(int)), this, SLOT(QSliderToQDoubleSpinBox(int)));
connect(textXYSteps, SIGNAL(valueChanged(double)), this, SLOT(QDoubleSpinBoxToQSlider(double)));
sliderXYSteps->setRange(0, 5000);
textXYSteps->setRange(0,50);
sliderXYSteps->setRange(0, 1000);
textXYSteps->setRange(0,10);
textXYSteps->setSingleStep(0.1);
textXYSteps->setValue(10);
textXYSteps->setValue(0.5);
connect(sliderXYSpeed, SIGNAL(valueChanged(int)), textXYSpeed, SLOT(setValue(int)));
connect(textXYSpeed, SIGNAL(valueChanged(int)), sliderXYSpeed, SLOT(setValue(int)));
sliderXYSpeed->setRange(1, 10000);
textXYSpeed->setRange(1, 10000);
textXYSpeed->setValue(4000);
sliderXYSpeed->setRange(1, 4000);
textXYSpeed->setRange(1, 4000);
textXYSpeed->setSingleStep(100);
textXYSpeed->setValue(600);
connect(sliderZSteps, SIGNAL(valueChanged(int)), this, SLOT(QSliderToQDoubleSpinBox(int)));
connect(textZSteps, SIGNAL(valueChanged(double)), this, SLOT(QDoubleSpinBoxToQSlider(double)));
sliderZSteps->setRange(0, 5000);
textZSteps->setRange(0, 50);
sliderZSteps->setRange(0, 1000);
textZSteps->setRange(0, 10);
textZSteps->setSingleStep(0.1);
textZSteps->setValue(10);
textZSteps->setValue(0.5);
connect(sliderZSpeed, SIGNAL(valueChanged(int)), textZSpeed, SLOT(setValue(int)));
connect(textZSpeed, SIGNAL(valueChanged(int)), sliderZSpeed, SLOT(setValue(int)));
sliderZSpeed->setRange(1, 10000);
textZSpeed->setRange(1, 10000);
textZSpeed->setValue(1000);
sliderZSpeed->setRange(1, 1000);
textZSpeed->setRange(1, 1000);
textZSpeed->setSingleStep(100);
textZSpeed->setValue(400);
connect(sliderRepeatDelay, SIGNAL(valueChanged(int)), textRepeatDelay, SLOT(setValue(int)));
connect(textRepeatDelay, SIGNAL(valueChanged(int)), sliderRepeatDelay, SLOT(setValue(int)));
connect(textRepeatDelay, SIGNAL(valueChanged(int)), this, SLOT(UpdateTimer(int)));
sliderRepeatDelay->setRange(20, 500);
textRepeatDelay->setRange(20, 500);
textRepeatDelay->setValue(100);
sliderRepeatDelay->setRange(1, 200);
textRepeatDelay->setRange(1, 200);
textRepeatDelay->setValue(45);
 
QGridLayout *xyRepeatLayout = new QGridLayout();
xyRepeatLayout->addWidget(labelXYSteps, 0, 0);
228,28 → 241,40
QGroupBox *xyRepeatBox = new QGroupBox("Movement Settings");
xyRepeatBox->setLayout(xyRepeatLayout);
 
connect(sliderEForwardSteps, SIGNAL(valueChanged(int)), textEForwardSteps, SLOT(setValue(int)));
connect(textEForwardSteps, SIGNAL(valueChanged(int)), sliderEForwardSteps, SLOT(setValue(int)));
sliderEForwardSteps->setRange(1, 10000);
textEForwardSteps->setRange(1, 10000);
textEForwardSteps->setValue(4000);
connect(sliderEForwardSteps, SIGNAL(valueChanged(int)), this, SLOT(QSliderToQDoubleSpinBox(int)));
connect(textEForwardSteps, SIGNAL(valueChanged(double)), this, SLOT(QDoubleSpinBoxToQSlider(double)));
sliderEForwardSteps->setRange(0, 10000);
textEForwardSteps->setRange(0, 100);
textEForwardSteps->setSingleStep(0.1);
textEForwardSteps->setValue(8);
connect(sliderEForwardSpeed, SIGNAL(valueChanged(int)), textEForwardSpeed, SLOT(setValue(int)));
connect(textEForwardSpeed, SIGNAL(valueChanged(int)), sliderEForwardSpeed, SLOT(setValue(int)));
sliderEForwardSpeed->setRange(1, 10000);
textEForwardSpeed->setRange(1, 10000);
textEForwardSpeed->setValue(1000);
connect(sliderEBackwardSteps, SIGNAL(valueChanged(int)), textEBackwardSteps, SLOT(setValue(int)));
connect(textEBackwardSteps, SIGNAL(valueChanged(int)), sliderEBackwardSteps, SLOT(setValue(int)));
sliderEBackwardSteps->setRange(1, 10000);
textEBackwardSteps->setRange(1, 10000);
textEBackwardSteps->setValue(2000);
textEForwardSpeed->setSingleStep(100);
textEForwardSpeed->setValue(800);
connect(sliderEBackwardSteps, SIGNAL(valueChanged(int)), this, SLOT(QSliderToQDoubleSpinBox(int)));
connect(textEBackwardSteps, SIGNAL(valueChanged(double)), this, SLOT(QDoubleSpinBoxToQSlider(double)));
sliderEBackwardSteps->setRange(0, 10000);
textEBackwardSteps->setRange(0, 100);
textEBackwardSteps->setSingleStep(0.1);
textEBackwardSteps->setValue(2);
connect(sliderEBackwardSpeed, SIGNAL(valueChanged(int)), textEBackwardSpeed, SLOT(setValue(int)));
connect(textEBackwardSpeed, SIGNAL(valueChanged(int)), sliderEBackwardSpeed, SLOT(setValue(int)));
sliderEBackwardSpeed->setRange(1, 10000);
textEBackwardSpeed->setRange(1, 10000);
textEBackwardSpeed->setValue(2000);
textEBackwardSpeed->setSingleStep(100);
textEBackwardSpeed->setValue(1600);
connect(sliderExtrusionHeight, SIGNAL(valueChanged(int)), this, SLOT(QSliderToQDoubleSpinBox(int)));
connect(textExtrusionHeight, SIGNAL(valueChanged(double)), this, SLOT(QDoubleSpinBoxToQSlider(double)));
connect(textExtrusionHeight, SIGNAL(valueChanged(double)), this, SLOT(SetBaseHeight()));
sliderExtrusionHeight->setRange(0, 400);
textExtrusionHeight->setRange(0, 4);
textExtrusionHeight->setSingleStep(0.1);
textExtrusionHeight->setValue(2);
connect(sliderEZSteps, SIGNAL(valueChanged(int)), this, SLOT(QSliderToQDoubleSpinBox(int)));
connect(textEZSteps, SIGNAL(valueChanged(double)), this, SLOT(QDoubleSpinBoxToQSlider(double)));
connect(textEZSteps, SIGNAL(valueChanged(double)), this, SLOT(SetBaseHeight()));
sliderEZSteps->setRange(0, 1000);
textEZSteps->setRange(0, 10);
textEZSteps->setSingleStep(0.1);
268,9 → 293,12
extruderLayout->addWidget(labelEBackwardSpeed, 4, 0);
extruderLayout->addWidget(sliderEBackwardSpeed, 4, 1);
extruderLayout->addWidget(textEBackwardSpeed, 4, 2);
extruderLayout->addWidget(labelEZSteps, 5, 0);
extruderLayout->addWidget(sliderEZSteps, 5, 1);
extruderLayout->addWidget(textEZSteps, 5, 2);
extruderLayout->addWidget(labelExtrusionHeight, 5, 0);
extruderLayout->addWidget(sliderExtrusionHeight, 5, 1);
extruderLayout->addWidget(textExtrusionHeight, 5, 2);
extruderLayout->addWidget(labelEZSteps, 6, 0);
extruderLayout->addWidget(sliderEZSteps, 6, 1);
extruderLayout->addWidget(textEZSteps, 6, 2);
 
QGroupBox *extruderBox = new QGroupBox("Extruder Settings");
extruderBox->setLayout(extruderLayout);
289,9 → 317,10
mainLayout->addLayout(column1Layout);
mainLayout->addLayout(column2Layout);
 
EnableTransmit(false);
 
setLayout(mainLayout);
setFixedSize(sizeHint());
 
}
 
PasteController::~PasteController()
301,8 → 330,34
 
void PasteController::EnableTransmit(bool en) {
connected = en;
btnEnableHotkeys->setEnabled(en);
btnInit->setEnabled(en);
btnHome->setEnabled(en);
btnForward->setEnabled(en);
btnBackward->setEnabled(en);
btnLeft->setEnabled(en);
btnRight->setEnabled(en);
btnDown->setEnabled(en);
btnUp->setEnabled(en);
btnExtrude->setEnabled(en);
}
 
void PasteController::InitializePrinter() {
queueCmds->enqueue("G90\n"); // Absolute positioning
queueCmds->enqueue("M83\n"); // Relative extrusion
queueCmds->enqueue("M204 S3000"); // Default acceleration (movement)
queueCmds->enqueue("M205 X10"); // Maximum XY jerk
queueCmds->enqueue("M302"); // Allow cold extrusions
 
if (!transmittingData) {
transmittingData = true;
emit TransmitData(queueCmds->head().toUtf8());
}
 
ResetPosition();
SetBaseHeight();
}
 
void PasteController::ToggleHotkeys() {
if (hotkeysEnabled) {
qApp->removeEventFilter(this);
314,20 → 369,45
hotkeysEnabled = !hotkeysEnabled;
}
 
void PasteController::UpdatePosition() {
if (X_Incr && !X_Decr) xPos += textXYSteps->value();
if (!X_Incr && X_Decr) xPos -= textXYSteps->value();
if (Y_Incr && !Y_Decr) yPos += textXYSteps->value();
if (!Y_Incr && Y_Decr) yPos -= textXYSteps->value();
if (Z_Incr && !Z_Decr) zPos += textZSteps->value();
if (!Z_Incr && Z_Decr) zPos -= textZSteps->value();
void PasteController::MoveToolhead() {
if (X_Incr && !X_Decr)
xPos = (xPos + textXYSteps->value() < X_MAX) ? xPos + textXYSteps->value() : X_MAX;
if (!X_Incr && X_Decr)
xPos = (xPos - textXYSteps->value() > X_MIN) ? xPos - textXYSteps->value() : X_MIN;
if (Y_Incr && !Y_Decr)
yPos = (yPos + textXYSteps->value() < Y_MAX) ? yPos + textXYSteps->value() : Y_MAX;
if (!Y_Incr && Y_Decr)
yPos = (yPos - textXYSteps->value() > Y_MIN) ? yPos - textXYSteps->value() : Y_MIN;
if (Z_Incr && !Z_Decr)
zPos = (zPos + textZSteps->value() < Z_MAX) ? zPos + textZSteps->value() : Z_MAX;
if (!Z_Incr && Z_Decr)
zPos = (zPos - textZSteps->value() > Z_MIN) ? zPos - textZSteps->value() : Z_MIN;
 
textXValue->setText(QString::number(xPos, 'f', 2));
textYValue->setText(QString::number(yPos, 'f', 2));
textZValue->setText(QString::number(zPos, 'f', 2));
UpdatePosition();
 
QString str;
QTextStream strIO(&str);
if (Z_Incr || Z_Decr) {
strIO << "G0";
strIO << " Z" << zPos;
strIO << " F" << textZSpeed->value();
strIO << "\n";
} else {
strIO << "G0";
strIO << " X" << xPos;
strIO << " Y" << yPos;
strIO << " F" << textXYSpeed->value();
strIO << "\n";
}
 
queueCmds->enqueue(str);
if (!transmittingData) {
transmittingData = true;
emit TransmitData(queueCmds->head().toUtf8());
}
}
 
void PasteController::UpdatePositionSingle() {
void PasteController::MoveToolheadSingle() {
if (QObject::sender() == btnRight) xPos += textXYSteps->value();
if (QObject::sender() == btnLeft) xPos -= textXYSteps->value();
if (QObject::sender() == btnForward) yPos += textXYSteps->value();
335,19 → 415,131
if (QObject::sender() == btnUp) zPos += textZSteps->value();
if (QObject::sender() == btnDown) zPos -= textZSteps->value();
 
UpdatePosition();
 
QString str;
QTextStream strIO(&str);
if (QObject::sender() == btnRight || QObject::sender() == btnLeft ||
QObject::sender() == btnForward || QObject::sender() == btnBackward) {
strIO << "G0";
strIO << " X" << xPos;
strIO << " Y" << yPos;
strIO << " F" << textXYSpeed->value();
strIO << "\n";
} else if (QObject::sender() == btnUp || QObject::sender() == btnDown) {
strIO << "G0";
strIO << " Z" << zPos;
strIO << " F" << textZSpeed->value();
strIO << "\n";
}
 
queueCmds->enqueue(str);
if (!transmittingData) {
transmittingData = true;
emit TransmitData(queueCmds->head().toUtf8());
}
}
 
void PasteController::UpdatePosition() {
textXValue->setText(QString::number(xPos, 'f', 2));
textYValue->setText(QString::number(yPos, 'f', 2));
textZValue->setText(QString::number(zPos, 'f', 2));
}
 
void PasteController::UpdateTimer(int delay) {
tmrUpdate->setInterval(delay);
void PasteController::ExtrudeSingle() {
QString str;
// Move printdown down
str = "G0 Z" + QString::number(textExtrusionHeight->value()) +
" F" + QString::number(textZSpeed->value()) + "\n";
zPos = textExtrusionHeight->value();
queueCmds->enqueue(str);
 
// Extrude paste
str = "G0 E-" + QString::number(textEForwardSteps->value()) +
" F" + QString::number(textEForwardSpeed->value()) + "\n";
queueCmds->enqueue(str);
 
// Retract paste
str = "G0 E" + QString::number(textEBackwardSteps->value()) +
" F" + QString::number(textEBackwardSpeed->value()) + "\n";
queueCmds->enqueue(str);
 
// Move printhead up
str = "G0 Z" + QString::number(textEZSteps->value() + textExtrusionHeight->value()) +
" F" + QString::number(textZSpeed->value()) + "\n";
zPos = textEZSteps->value() + textExtrusionHeight->value();
queueCmds->enqueue(str);
 
if (!transmittingData) {
transmittingData = true;
emit TransmitData(queueCmds->head().toUtf8());
}
}
 
void PasteController::ResetPosition() {
xPos = yPos = zPos = 0;
 
queueCmds->enqueue("G28\n"); // Home printhead
if (!transmittingData) {
transmittingData = true;
emit TransmitData(queueCmds->head().toUtf8());
}
 
MoveToolhead();
}
 
void PasteController::ProcessData(QByteArray data) {
static QString recvData;
if (transmittingData) {
// Need to wait for acknowledgement from the printer after each command
recvData.append(QString(data));
while (recvData.indexOf('\n') != -1) {
QString ret = recvData.left(recvData.indexOf('\n')+1);
recvData.remove(0, recvData.indexOf('\n')+1);
bool transmit = false;
if (ret.startsWith("ok")) {
// Last command successfully processed
queueCmds->dequeue();
transmit = true;
} else if (ret.startsWith("rs" || ret.startsWith("Resend"))) {
transmit = true;
} else if (ret.startsWith("!!" || ret.startsWith("Error"))) {
emit UpdateStatus("Hardware fault detected!");
queueCmds->clear();
} else if (ret.startsWith("echo")) {
// Ignore anything else sent
}
if (transmit && !queueCmds->isEmpty()) {
emit TransmitData(queueCmds->head().toUtf8());
} else if (queueCmds->isEmpty()){
transmittingData = false;
}
}
}
}
 
void PasteController::SetBaseHeight() {
if (connected) {
QString str = "G0 Z" + QString::number(textEZSteps->value() + textExtrusionHeight->value()) +
" F" + QString::number(textZSpeed->value()) + "\n";
zPos = textEZSteps->value() + textExtrusionHeight->value();
queueCmds->enqueue(str);
 
if (!transmittingData) {
transmittingData = true;
emit TransmitData(queueCmds->head().toUtf8());
}
UpdatePosition();
}
}
 
void PasteController::QSliderToQDoubleSpinBox(int) {
textXYSteps->setValue((double)sliderXYSteps->value()/100);
textZSteps->setValue((double)sliderZSteps->value()/100);
textEZSteps->setValue((double)sliderEZSteps->value()/100);
textEForwardSteps->setValue((double)sliderEForwardSteps->value()/100);
textEBackwardSteps->setValue((double)sliderEBackwardSteps->value()/100);
textExtrusionHeight->setValue((double)sliderExtrusionHeight->value()/100);
}
 
void PasteController::QDoubleSpinBoxToQSlider(double) {
354,13 → 546,11
sliderXYSteps->setValue(textXYSteps->value()*100);
sliderZSteps->setValue(textZSteps->value()*100);
sliderEZSteps->setValue(textEZSteps->value()*100);
sliderEForwardSteps->setValue((double)textEForwardSteps->value()*100);
sliderEBackwardSteps->setValue((double)textEBackwardSteps->value()*100);
sliderExtrusionHeight->setValue((double)textExtrusionHeight->value()*100);
}
 
void PasteController::ResetPosition() {
xPos = yPos = zPos = 0;
UpdatePosition();
}
 
bool PasteController::eventFilter(QObject *obj, QEvent *event)
{
// Only process keyboard press and release events
399,9 → 589,15
btnExtrude->setDown(true);
E_Incr = keychange = true;
}
if (X_Incr || X_Decr || Y_Incr || Y_Decr || Z_Incr || Z_Decr || E_Incr) {
UpdatePosition();
tmrUpdate->start();
if (E_Incr) {
ExtrudeSingle();
} else if (X_Incr || X_Decr || Y_Incr || Y_Decr || Z_Incr || Z_Decr) {
MoveToolhead();
if (keyevent->modifiers() == Qt::ShiftModifier) {
tmrUpdate->start(textRepeatDelay->value() * SLOW_MULTIPLIER);
} else {
tmrUpdate->start(textRepeatDelay->value());
}
}
if (keychange) return true;
}
440,7 → 636,7
btnExtrude->setDown(false);
E_Incr = keychange = false;
}
if (!X_Incr && !X_Decr && !Y_Incr && !Y_Decr && !Z_Incr && !Z_Decr && !E_Incr) {
if (!X_Incr && !X_Decr && !Y_Incr && !Y_Decr && !Z_Incr && !Z_Decr) {
tmrUpdate->stop();
}
if (keychange) return true;