Skip to content

Commit

Permalink
Program hang on non zero length command queue on close fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denvi committed Aug 12, 2015
1 parent 2cff1df commit 2ee64f8
Show file tree
Hide file tree
Showing 34 changed files with 158 additions and 3 deletions.
7 changes: 7 additions & 0 deletions arcproperties.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "ArcProperties.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#include "arcproperties.h"

ArcProperties::ArcProperties(QObject *parent) : QObject(parent)
Expand Down
7 changes: 7 additions & 0 deletions arcproperties.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "ArcProperties.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef ARCPROPERTIES_H
#define ARCPROPERTIES_H

Expand Down
Binary file modified bin/grblControl.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions frmabout.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include <QDesktopServices>
#include "frmabout.h"
#include "ui_frmabout.h"
Expand Down
3 changes: 3 additions & 0 deletions frmabout.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef FRMABOUT_H
#define FRMABOUT_H

Expand Down
16 changes: 13 additions & 3 deletions frmmain.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include <QFileDialog>
#include <QTextStream>
#include <QDebug>
Expand Down Expand Up @@ -90,8 +93,7 @@ frmMain::frmMain(QWidget *parent) :
}

frmMain::~frmMain()
{
if (m_serialPort.isOpen()) m_serialPort.close();
{
saveSettings();

delete ui;
Expand Down Expand Up @@ -266,6 +268,8 @@ void frmMain::sendCommand(QString command, int tableIndex)
command = cq.command;
tableIndex = cq.tableIndex;

if (!m_serialPort.isOpen()) return;

// qDebug() << "get queue:" << cq.command;
}

Expand Down Expand Up @@ -308,7 +312,7 @@ void frmMain::grblReset()
m_timerToolAnimation.stop();

m_commands.clear();
m_queue.clear();
// m_queue.clear();

ui->txtConsole->appendPlainText("[CTRL+X]");
m_serialPort.write(QByteArray(1, (char)24));
Expand Down Expand Up @@ -717,6 +721,12 @@ void frmMain::timerEvent(QTimerEvent *te)
}
}

void frmMain::closeEvent(QCloseEvent *ce)
{
if (m_serialPort.isOpen()) m_serialPort.close();
if (m_queue.length() > 0) m_commands.clear();
}

void frmMain::on_actFileExit_triggered()
{
close();
Expand Down
4 changes: 4 additions & 0 deletions frmmain.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef FRMMAIN_H
#define FRMMAIN_H

Expand Down Expand Up @@ -100,6 +103,7 @@ private slots:
void showEvent(QShowEvent *se);
void resizeEvent(QResizeEvent *re);
void timerEvent(QTimerEvent *);
void closeEvent(QCloseEvent *ce);

private:
const int BUFFERLENGTH = 127;
Expand Down
3 changes: 3 additions & 0 deletions frmsettings.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "frmsettings.h"
#include "ui_frmsettings.h"
#include <QtSerialPort/QSerialPort>
Expand Down
3 changes: 3 additions & 0 deletions frmsettings.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef FRMSETTINGS_H
#define FRMSETTINGS_H

Expand Down
3 changes: 3 additions & 0 deletions gcodedrawer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include <QDebug>
#include "gcodedrawer.h"
#include "math.h"
Expand Down
3 changes: 3 additions & 0 deletions gcodedrawer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GCODEDRAWER_H
#define GCODEDRAWER_H

Expand Down
7 changes: 7 additions & 0 deletions gcodeparser.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodeParser.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#include <QListIterator>
#include <QDebug>
#include "gcodeparser.h"
Expand Down
7 changes: 7 additions & 0 deletions gcodeparser.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodeParser.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GCODEPARSER_H
#define GCODEPARSER_H

Expand Down
7 changes: 7 additions & 0 deletions gcodepreprocessorutils.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodePreprocessorUtils.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#include <QRegExp>
#include <QDebug>
#include <QVector3D>
Expand Down
7 changes: 7 additions & 0 deletions gcodepreprocessorutils.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodePreprocessorUtils.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GCODEPREPROCESSORUTILS_H
#define GCODEPREPROCESSORUTILS_H

Expand Down
3 changes: 3 additions & 0 deletions gcodetablemodel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "gcodetablemodel.h"

GCodeItem::GCodeItem()
Expand Down
3 changes: 3 additions & 0 deletions gcodetablemodel.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GCODETABLEMODEL_H
#define GCODETABLEMODEL_H

Expand Down
7 changes: 7 additions & 0 deletions gcodeviewparse.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodeViewParse.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#include <QDebug>
#include "gcodeviewparse.h"

Expand Down
7 changes: 7 additions & 0 deletions gcodeviewparse.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "GcodeViewParse.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GCODEVIEWPARSE_H
#define GCODEVIEWPARSE_H

Expand Down
3 changes: 3 additions & 0 deletions gldrawable.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "gldrawable.h"

GLDrawable::GLDrawable(QObject *parent) :
Expand Down
3 changes: 3 additions & 0 deletions gldrawable.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GLDRAWABLE_H
#define GLDRAWABLE_H

Expand Down
3 changes: 3 additions & 0 deletions glwidget.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "glwidget.h"
#include "tooldrawer.h"
#include <QDebug>
Expand Down
3 changes: 3 additions & 0 deletions glwidget.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef GLWIDGET_H
#define GLWIDGET_H

Expand Down
7 changes: 7 additions & 0 deletions linesegment.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "LineSegment.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#include "linesegment.h"
#include <QDebug>

Expand Down
7 changes: 7 additions & 0 deletions linesegment.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "LineSegment.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef LINESEGMENT_H
#define LINESEGMENT_H

Expand Down
3 changes: 3 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "frmmain.h"
#include "gcodepreprocessorutils.h"
#include "gcodeparser.h"
Expand Down
7 changes: 7 additions & 0 deletions pointsegment.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "PointSegment.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#include <QVector>

#include "pointsegment.h"
Expand Down
7 changes: 7 additions & 0 deletions pointsegment.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is a part of "grblControl" application.
// This file was originally ported from "PointSegment.java" class
// of "Universal GcodeSender" application written by Will Winder
// (https://github.com/winder/Universal-G-Code-Sender)

// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef POINTSEGMENT_H
#define POINTSEGMENT_H

Expand Down
3 changes: 3 additions & 0 deletions styledtoolbutton.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "styledtoolbutton.h"
#include <QDebug>
#include <QEvent>
Expand Down
3 changes: 3 additions & 0 deletions styledtoolbutton.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef STYLEDTOOLBUTTON_H
#define STYLEDTOOLBUTTON_H

Expand Down
3 changes: 3 additions & 0 deletions tablewidget.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "tablewidget.h"
#include <QEvent>
#include <QKeyEvent>
Expand Down
3 changes: 3 additions & 0 deletions tablewidget.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef TABLEWIDGET_H
#define TABLEWIDGET_H

Expand Down
3 changes: 3 additions & 0 deletions tooldrawer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#include "tooldrawer.h"
#include "math.h"

Expand Down
3 changes: 3 additions & 0 deletions tooldrawer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich

#ifndef TOOLDRAWER_H
#define TOOLDRAWER_H

Expand Down

0 comments on commit 2ee64f8

Please sign in to comment.