Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ SERVER_BASED_SEARCH = NO
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.

GENERATE_LATEX = NO
GENERATE_LATEX = YES

# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
Expand Down Expand Up @@ -1325,7 +1325,7 @@ USE_PDFLATEX = YES
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.

LATEX_BATCHMODE = NO
LATEX_BATCHMODE = YES

# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
Expand Down Expand Up @@ -1633,7 +1633,7 @@ HIDE_UNDOC_RELATIONS = YES
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)

HAVE_DOT = NO
HAVE_DOT = YES

# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
# allowed to run in parallel. When set to 0 (the default) doxygen will
Expand Down Expand Up @@ -1668,7 +1668,7 @@ DOT_FONTPATH =
# indirect inheritance relations. Setting this tag to YES will force the
# CLASS_DIAGRAMS tag to NO.

CLASS_GRAPH = YES
CLASS_GRAPH = NO

# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
Expand All @@ -1686,7 +1686,7 @@ GROUP_GRAPHS = YES
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.

UML_LOOK = NO
UML_LOOK = YES

# If the UML_LOOK tag is enabled, the fields and methods are shown inside
# the class node. If there are many fields or methods and many nodes the
Expand Down
15 changes: 13 additions & 2 deletions src/mainandlog/logviewerdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#include "logviewerdialog.h"

#include <qglobal.h>

#if QT_VERSION >= 0x050000
#include <QtWidgets\QVBoxLayout>
#include <QtWidgets\QHBoxLayout>
#include <QtWidgets\QPlainTextEdit>
#include <QtWidgets\QPushButton>
#include <QtWidgets\QFileDialog>
#include <QtWidgets\QMessageBox>
#else
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPlainTextEdit>
#include <QPushButton>
#include <QFileDialog>
#include <QMessageBox>
#endif

#include <QDir>
#include <QFile>
#include <QtWidgets\QMessageBox>
#include <QTextStream>
#include <QCloseEvent>
#include <QKeyEvent>
Expand Down
8 changes: 7 additions & 1 deletion src/mainandlog/logviewerdialog.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#ifndef LOGVIEWERDIALOG_H
#define LOGVIEWERDIALOG_H

#include <QtWidgets\QDialog>
#include <qglobal.h>


#if QT_VERSION >= 0x050000
#include <QtWidgets\QDialog>
#else
#include <QDialog>
#endif
QT_BEGIN_NAMESPACE
class QTextBrowser;
class QPlainTextEdit;
Expand Down
26 changes: 23 additions & 3 deletions src/mainandlog/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The main function instantiates the Main Window object,
to which all the various 'wigets' are attached. (ie: the serial_widget)
*/

#include <qglobal.h>

#ifndef __PRETTY_FUNCTION__
#ifndef __FUNCDNAME__
Expand All @@ -21,7 +21,12 @@
*/
bool VERBOSE = true;

#include <QtWidgets\QApplication>
#if QT_VERSION >= 0x050000
#include <QtWidgets\QApplication>
#else
#include <QtGui/QApplication>
#endif

#include <QString>
#include <QtDebug>
#include <QPointer>
Expand All @@ -40,11 +45,22 @@ QPointer<LogViewer> logViewer;
/*!
Custom message handler that redirects messages to a log viewer (if available).
*/
#if QT_VERSION >= 0x050000
void MyMessageOutput(QtMsgType Type, const QMessageLogContext& Context, const QString &Message)
{
if(logViewer)
logViewer->outputMessage( Type, Message );
}
#else
void myMessageOutput(QtMsgType type, const char *msg)
{
if(logViewer)
{
logViewer->outputMessage( type, msg );
}
}
#endif


int main(int argc, char *argv[])
{
Expand All @@ -59,8 +75,12 @@ int main(int argc, char *argv[])

// Instantiate a log viewer and redirect debug messages to it.
logViewer = new LogViewer;
qInstallMessageHandler(MyMessageOutput);

#if QT_VERSION >= 0x050000
qInstallMessageHandler(MyMessageOutput);
#else
qInstallMsgHandler(myMessageOutput);
#endif
// Instantiate the Main Window
MainWindow w(0, logViewer);
w.setAttribute(Qt::WA_AlwaysShowToolTips);
Expand Down
13 changes: 11 additions & 2 deletions src/mainandlog/mainwindow.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <qglobal.h>

#if QT_VERSION >= 0x050000
#include <QtWidgets\QMainWindow>
#include <QPointer>
#include <QtWidgets\QMenu>
#include <QtWidgets\QMenuBar>
#include <QtWidgets\QAction>
#include <abstractserial.h>
#else
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#endif

#include <abstractserial.h>
#include <QPointer>

#include "serialtools/connectioncontroller.h"
#include "servoboard/servoboardcontroller.h"
Expand Down
2 changes: 2 additions & 0 deletions src/serialtools/connectioncontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ void ConnectionController::open(QString port)
if (!this->port->open(QIODevice::ReadWrite))
{
qDebug() << "Port failed to open in connectControl";
view->connectionFailedWarning();
return;
}

this->port->setBaudRate("9600 baud");
Expand Down
6 changes: 6 additions & 0 deletions src/serialtools/infowidget.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#ifndef INFOWIDGET_H
#define INFOWIDGET_H

#include <qglobal.h>

#if QT_VERSION >= 0x050000
#include <QWidget>
#else
#include <QtGui/QWidget>
#endif

namespace Ui {
class InfoWidget;
Expand Down
20 changes: 19 additions & 1 deletion src/serialtools/serial_widget.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#include <qglobal.h>


#if QT_VERSION >= 0x050000
#include <QtWidgets\QMessageBox>
#else
#include <QMessageBox>
#endif

#include <QtCore/QStringList>
#include <QtCore/QDebug>
#include <QtWidgets\QMessageBox>



#include "serial_widget.h"
#include "ui_serial_widget.h"
Expand Down Expand Up @@ -389,6 +399,14 @@ void SerialWidget::updateInfoData(SerialDeviceEnumerator* enumerator, QString& n
this->infoWidget->updateInfo(data);
}
}

void SerialWidget::connectionFailedWarning()
{
QMessageBox warn(this);
warn.setText(tr("Connection failed, check to make sure the port is not being used elsewhere"));
warn.setIcon(QMessageBox::Warning);
warn.exec();
}
/*

Returns the AbstractSerial Object.
Expand Down
14 changes: 11 additions & 3 deletions src/serialtools/serial_widget.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#ifndef SERIALWIDGET_H
#define SERIALWIDGET_H
#include <qglobal.h>


#if QT_VERSION >= 0x050000
#include <QtWidgets\QWidget>
#include <QtCore\QDateTime>
#else
#include <QtGui/QWidget>
#include <QtCore/QDateTime>
#endif

#include <QtWidgets\QWidget>
#include <QtCore\QDateTime>


QT_BEGIN_NAMESPACE
Expand Down Expand Up @@ -38,7 +46,7 @@ class SerialWidget : public QWidget
QStringList& parity, QStringList& stopBits,
QStringList& flow);
void updateInfoData(SerialDeviceEnumerator* enumerator,QString& name);

void connectionFailedWarning();

void initSerialWidgetCloseState();
void initSerialWidgetOpenState();
Expand Down
7 changes: 7 additions & 0 deletions src/serialtools/tracewidget.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#include <qglobal.h>


#if QT_VERSION >= 0x050000
#include <QtWidgets\QScrollBar>
#else
#include <QScrollBar>
#endif

#include "tracewidget.h"
#include "ui_tracewidget.h"
Expand Down
8 changes: 7 additions & 1 deletion src/serialtools/tracewidget.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#ifndef TRACEWIDGET_H
#define TRACEWIDGET_H
#include <qglobal.h>

#include <QtWidgets\QWidget>

#if QT_VERSION >= 0x050000
#include <QtWidgets\QWidget>
#else
#include <QWidget>
#endif

namespace Ui {
class TraceWidget;
Expand Down
6 changes: 6 additions & 0 deletions src/servoboard/advancedlineoptionsdialog.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#ifndef ADVANCEDLINEOPTIONSDIALOG_H
#define ADVANCEDLINEOPTIONSDIALOG_H
#include <qglobal.h>


#if QT_VERSION >= 0x050000
#include <QtWidgets\QDialog>
#else
#include <QDialog>
#endif
#include <QDebug>

namespace Ui {
Expand Down
9 changes: 8 additions & 1 deletion src/servoboard/servoboardcontroller.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#ifndef SERVOBOARDCONTROLLER_H
#define SERVOBOARDCONTROLLER_H
#include <qglobal.h>



#include <QObject>
#include <QtWidgets\QFileDialog>
#if QT_VERSION >= 0x050000
#include <QtWidgets\QFileDialog>
#else
#include <QtGui/QFileDialog>
#endif
#include <QTimer>

#include <abstractserial.h>
Expand Down
8 changes: 7 additions & 1 deletion src/servoboard/servocontrolbundle.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#ifndef SERVOCONTROLBUNDLE_H
#define SERVOCONTROLBUNDLE_H
#include <qglobal.h>

#include <QtWidgets\QWidget>

#if QT_VERSION >= 0x050000
#include <QtWidgets\QWidget>
#else
#include <QWidget>
#endif
#include "ui_servocontrolbundle.h"

class ServoControlBundle : public QWidget
Expand Down