Enable continuous integration through Travis CI
ADD
.travis.yml
+
+before_install:
+ - sudo add-apt-repository --yes ppa:beineri/opt-qt593-trusty
+ - sudo apt-get update
+ - sudo apt-get install qt59-meta-minimal libc6-dev
+ # C++14
+ - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+ - sudo apt-get update -qq
+
+script:
+ # C++14
+ - sudo apt-get install -qq g++-6
+ - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
+ # Set new Qt environment
+ - source /opt/qt59/bin/qt59-env.sh
+ - qmake --version
+ # build
+ - qmake Ripes.pro "CONFIG+=TRAVIS_CI"
+ - make

MODIFY
README.md
README.md
## Ripes
+[![Build Status](https://travis-ci.org/mortbopet/Ripes.svg?branch=master)](https://travis-ci.org/mortbopet/Ripes/)
+
+Ripes is a graphical 5-stage processor pipeline simulator and integrated development environment built for the RISC-V instruction set architecture.
<p align="center">
<a href="https://github.com/mortbopet/Ripes/">
- <img src="https://github.com/mortbopet/Ripes/blob/master/resources/logo.png?raw=true" width="250" height="250" />
+ <img src="https://github.com/mortbopet/Ripes/blob/master/resources/logo.png?raw=true" width="200" height="200" />
</a>
</p>
-Ripes is a graphical 5-stage pipeline simulator and integrated development environment built for the RISC-V instruction set architecture.
## Features
* **Simulator**:
@@ -66,6 +68,31 @@ To navigate the memory view, one can use the scroll view to scroll through the m
## Building
Since RISC-V sim is built using pure C++ and Qt, all platforms that support Qt should be able to build and run the app.
+
+### Minimal (Linux)
+If you do not wish to download the entire Qt environment, the project can be built given the following dependencies are available
+* *g++* version with support for C++14
+* *qmake* with Qt version 5.5 or higher
+A minimal Qt installation can be found at https://launchpad.net/~beineri.
+A Qt environment can be set up as follows:
+```
+sudo add-apt-repository --yes ppa:beineri/opt-qt593-xenial
+apt-get update -qq
+sudo apt-get install qt59-meta-minimal
+source /opt/qt59/bin/qt59-env.sh
+```
+Verify that you have the correct qmake version installed:
+```
+qmake --version
+```
+Navigate to the project folder and run
+```
+qmake Ripes.pro
+make
+```
+
+
+### Using QtCreator (All platforms)
Download Qt for Open Source development at https://www.qt.io/download.
Using the Qt installer, only the prebuilt components for your chosen compiler needs to be selected. When installing Qt, you also install QtCreator.
@@ -73,6 +100,7 @@ Open QtCreator and go to *Tools->Options->Build & Run->Kits* and make sure that
Open *Ripes.pro* in QtCreator, and build in either release or debug mode.
When building Qt apps, various dynamic libraries are required. Running the app through QtCreator, all Qt dll's are loaded into the path, and available for the application without any extra effort. If you wish to deploy or distribute the application, the required dependencies must be packaged with the compiled binary.
+### Deploying
For Windows, `windeployqt` is a command that automatically detects the dependencies of your compiled executable, and copies the required Qt libraries into the executable folder. You can find this tool in your Qt installation folder
Similarly, `macdeployqt` should be available on mac machines.

MODIFY
Ripes.pro
Ripes.pro
@@ -120,6 +120,9 @@ CONFIG(release, debug|release) {
OUTDIR = release
}
+TRAVIS_CI{
+ # Skip copy files step on travis
+} else {
COPIED {
} else {
if(win*){
@@ -133,3 +136,4 @@ COPIED {
QMAKE_EXTRA_TARGETS += first copydata
CONFIG += COPIED
}
+}

MODIFY
src/graphics/connection.cpp
src/graphics/connection.cpp
#include "connection.h"
+#include <cmath>
#include "shape.h"
#include <QFontMetrics>
@@ -9,7 +10,7 @@ static constexpr float Pi = 3.1415926535;
namespace {
inline double pointDistance(QPointF a, QPointF b) {
- return sqrt(pow(a.x() - b.x(), 2) + pow(a.y() - b.y(), 2));
+ return std::sqrt(std::pow(a.x() - b.x(), 2) + std::pow(a.y() - b.y(), 2));
}
} // namespace
using namespace std;
@@ -192,9 +193,9 @@ void Connection::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidg
}
QPointF destArrowP1 =
- *(line.end() - 1) + QPointF(sin(angle - Pi / 3) * m_arrowSize, cos(angle - Pi / 3) * m_arrowSize);
- QPointF destArrowP2 =
- *(line.end() - 1) + QPointF(sin(angle - Pi + Pi / 3) * m_arrowSize, cos(angle - Pi + Pi / 3) * m_arrowSize);
+ *(line.end() - 1) + QPointF(std::sin(angle - Pi / 3) * m_arrowSize, std::cos(angle - Pi / 3) * m_arrowSize);
+ QPointF destArrowP2 = *(line.end() - 1) + QPointF(std::sin(angle - Pi + Pi / 3) * m_arrowSize,
+ std::cos(angle - Pi + Pi / 3) * m_arrowSize);
painter->drawPolygon(QPolygonF() << *(line.end() - 1) << destArrowP1 << destArrowP2);
}

MODIFY
src/graphics/pipelinewidget.cpp
src/graphics/pipelinewidget.cpp
#include "shape.h"
#include <QRectF>
+#include <cmath>
#include <QCoreApplication>
#include <QWheelEvent>
@@ -575,7 +576,7 @@ QList<QGraphicsItem*> PipelineWidget::filterAllowedItems(Graphics::Shape* shape,
}
void PipelineWidget::wheelEvent(QWheelEvent* event) {
- scaleView(pow((double)2, -event->delta() / 1000.0));
+ scaleView(std::pow((double)2, -event->delta() / 1000.0));
}
void PipelineWidget::zoomIn() {

Enable continuous integration through Travis CI