Skip to content

Commit

Permalink
Merge pull request #5 from vetlewi/master
Browse files Browse the repository at this point in the history
Update with unit testing
  • Loading branch information
vetlewi committed Jan 13, 2016
2 parents 2f5b19e + 9a9a756 commit 858cfe8
Show file tree
Hide file tree
Showing 88 changed files with 10,485 additions and 138 deletions.
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: cpp

os:
- linux
- osx

compile:
- g++

sudo: required
dist: trusty

addons:
apt:
sources:
- ubuntu-sdk-team
packages:
- qtdeclarative5-dev
- qtbase5-dev
- libqt5webkit5-dev
- libsqlite3-dev
- qt5-default
- qttools5-dev-tools
before_install:
- scripts/travis_osx.sh
script:
- scripts/travis_qmake.sh
- make
- ./tests/tests

before_deploy:
- scripts/travis_deploy.sh

deploy:
provider: releases
api_key:
secure: UoWphEeoyOWf+tbeW75g1VfQcxQ+1VOUKUxus7xJ5uIuRShQqLm7UERn7N6hhFr5e4ccQk18zXs7t27kwYqZRDBH6cHwR8ns9EcXuZS4L9FQ20HS4+dqRxsUh2sTyhOx6jfY0PLOc7NvyBiVkcAjNMrybcekHzlrtNO8Gh9g08G1wi8j9dgJ4YDfRtppVkZn8MHcSmfKE4y+5rSun/Ztl91ofDW4Zm7sRct8XRJb+4woFajsPBKd+WhzcqYVohzvuwZFJNZCGofQUo0H6x82aQK63MsylFo2YonajNMeOkeBOYlxD4ZyHrr9nJW03+HtqEeYhcQi00/v8bGgcl79Ir5HbYrbqR9FFFw6HA1IQKNo+2A3t3OllPvuuHhiidXeriA8aDgPzMKJwzgTX4MSViM1JyiZC32W0oFMBHeMN8RGZoGWyYO7f13BllJxgy3GDJXUyNDgYwkH7J+igYz/kZElhZiFpiirl2wts0koqd4NSDDcC3A0iPt0Y3P+NZWnYIojxzA7LxrIXdb0wdIAVkknIMjV1wLFl7e7mdMMmlCAQQYMvNKhDhIiCWLVk2kRyqEYI4ofbAnrJ2ACCAWu5Vml/s4bwposjbP5tJ2zcvgxxYS+QH2OncnQfb5I8V7hClkgWLZ5arjxWa9+Y+8MboBDVNEk5dH3KIy4Hs4WW1M=
file: app/Qkinz.dmg
skip_cleanup: true
on:
condition: "$TRAVIS_OS_NAME = osx"
tags: true
144 changes: 8 additions & 136 deletions Qkinz.pro
Original file line number Diff line number Diff line change
@@ -1,138 +1,10 @@
#-------------------------------------------------
#
# Project created by QtCreator 2015-11-19T18:08:06
#
#-------------------------------------------------
TEMPLATE = subdirs
CONFIG += ordered

QT += core gui
SUBDIRS = \
src \
app \
tests

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport webkitwidgets

TARGET = Qkinz
TEMPLATE = app

unix {
BUILDDIR = $$PWD/build
DESTDIR = $$BUILDDIR
OBJECTS_DIR = $$BUILDDIR
MOC_DIR = $$BUILDDIR
RCC_DIR = $$BUILDDIR
UI_DIR = $$BUILDDIR
}

macx {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
QMAKE_CXXFLAGS += -std=c++11 #-O3
LIBS += -dead_strip #-stdlib=libc++
ICON = resources/media/Qkinz.icns
}
QMAKE_CXXFLAGS += -std=c++11


INCLUDEPATH += source \
source/gui/include \
source/kinematics/include \
source/math/include \
source/matter/include \
source/support/include \
source/tables/include

SOURCES += source/main.cpp \
source/gui/src/mainwindow.cpp \
source/gui/src/selectbeamform.cpp \
source/gui/src/qcustomplot.cpp \
source/gui/src/rundialog.cpp \
source/gui/src/selecttargetform.cpp \
source/gui/src/selecttelescopeform.cpp \
source/gui/src/selectfrontbackform.cpp \
source/kinematics/src/BetheBlock.cpp \
source/kinematics/src/BetheBlockComp.cpp \
source/kinematics/src/DickNorbury.cpp \
source/kinematics/src/FileSP.cpp \
source/kinematics/src/Iterative.cpp \
source/kinematics/src/Scattering.cpp \
source/kinematics/src/LNScattering.cpp \
source/kinematics/src/StoppingPower.cpp \
source/kinematics/src/Ziegler1985.cpp \
source/kinematics/src/ZieglerComp.cpp \
source/math/src/AbstractFunction.cpp \
source/math/src/Matrix.cpp \
source/math/src/PolyD2.cpp \
source/math/src/Polyfit.cpp \
source/math/src/Polynomial.cpp \
source/math/src/spline.cpp \
source/math/src/Vector.cpp \
source/matter/src/Material.cpp \
source/matter/src/Particle.cpp \
source/support/src/runsystem.cpp \
source/support/src/tablemakerhtml.cpp \
source/support/src/worker.cpp \
source/tables/src/ame2012_mass_tables.cpp \
source/tables/src/ame2012_masses.cpp \
source/tables/src/ziegler1985_table.cpp \
source/tables/src/excitation.cpp


HEADERS += source/gui/include/mainwindow.h \
source/gui/include/selectbeamform.h \
source/gui/include/qcustomplot.h \
source/gui/include/rundialog.h \
source/gui/include/selecttargetform.h \
source/gui/include/selecttelescopeform.h \
source/gui/include/selectfrontbackform.h \
source/kinematics/include/BetheBlock.h \
source/kinematics/include/BetheBlockComp.h \
source/kinematics/include/DickNorbury.h \
source/kinematics/include/FileSP.h \
source/kinematics/include/Iterative.h \
source/kinematics/include/Scattering.h \
source/kinematics/include/LNScattering.h \
source/kinematics/include/StoppingPower.h \
source/kinematics/include/Ziegler1985.h \
source/kinematics/include/ZieglerComp.h \
source/math/include/AbstractFunction.h \
source/math/include/Matrix.h \
source/math/include/PolyD2.h \
source/math/include/Polyfit.h \
source/math/include/Polynomial.h \
source/math/include/spline.h \
source/math/include/Vector.h \
source/matter/include/Material.h \
source/matter/include/Particle.h \
source/support/include/runsystem.h \
source/support/include/tablemakerhtml.h \
source/support/include/worker.h \
source/tables/include/ame2012_mass_tables.h \
source/tables/include/ame2012_masses.h \
source/tables/include/ziegler1985_table.h \
source/tables/include/excitation.h \
source/global.h \
source/types.h

FORMS += source/gui/forms/mainwindow.ui \
source/gui/forms/selectbeamform.ui \
source/gui/forms/selecttargetform.ui \
source/gui/forms/selecttelescopeform.ui \
source/gui/forms/rundialog.ui \
source/gui/forms/selectfrontbackform.ui

RESOURCES += resources/resorces.qrc

unix {
binfile.files += $$BUILDDIR/$$TARGET
binfile.path += /usr/bin/
icon.files += $$PWD/Qkinz.png
icon.path += /usr/share/$$TARGET
desktop.path = /usr/share/applications/
desktop.files = $$PWD/Qkinz.desktop
INSTALLS += binfile
INSTALLS += icon
INSTALLS += desktop
}

QMAKE_CLEAN += $$BUILDDIR/*.o \
$$BUILDDIR/moc_* \
$$BUILDDIR/ui_*

QMAKE_DISTCLEAN += $$PWD/Makefile \
$$PWD/*.pro.*
app.depends = src
tests.depends = src
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Qkinz
# Qkinz [![Build Status](https://travis-ci.org/vetlewi/Qkinz.svg?branch=master)](https://travis-ci.org/vetlewi/Qkinz)
Application for simulating the kinematics in Oslo Cyclotron Laboratory. The application uses stopping powers from J.F. Ziegler, J.P. Biersack, and U. Littmark, *The Stopping and Range of Ions in Solids*, Pergamon Press, New York (1985) for materials $Z\leq92$. Stopping powers are calculated from the Bethe-Block formula when $Z>92$. Masses used in the calculations are taken from the Atomic Mass Evaluation 2012 by M. Wang, G. Audi, A. H. Wapstra, F. G. Kondev,M. MacCormick, X. Xu, and B. Pfeiffer, Chinese Physics **C36**, 1603 (2012) [doi:10.1088/1674-1137/36/12/003](dx.doi.org/10.1088/1674-1137/36/12/003). Parts of the graphical component of the software is based on [**QCustomPlot**](http://qcustomplot.com/index.php/introduction).

![Screenshot](https://raw.githubusercontent.com/oslocyclotronlab/Qkinz/master/screenshot/Screenshot.png)
Expand Down Expand Up @@ -43,4 +43,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
along with this program. If not, see <http://www.gnu.org/licenses/>
20 changes: 20 additions & 0 deletions app/app.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include(../defaults.pri)

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport webkitwidgets

TARGET = Qkinz
TEMPLATE = app

macx {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
QMAKE_CXXFLAGS += -std=c++11 #-O3
LIBS += -dead_strip #-stdlib=libc++
ICON = ../resources/media/Qkinz.icns
}


SOURCES += main.cpp

LIBS += -L../src -lkinzgui
File renamed without changes.
9 changes: 9 additions & 0 deletions defaults.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
INCLUDEPATH += $$PWD/src \
$$PWD/src/gui/include \
$$PWD/src/kinematics/include \
$$PWD/src/math/include \
$$PWD/src/matter/include \
$$PWD/src/support/include \
$$PWD/src/tables/include

SRC_DIR = $$PWD
8 changes: 8 additions & 0 deletions scripts/travis_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ ${TRAVIS_OS_NAME} == "osx" ]; then
/usr/local/opt/qt5/bin/macdeployqt app/Qkinz.app -dmg

else
exit 0
fi
8 changes: 8 additions & 0 deletions scripts/travis_osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ ${TRAVIS_OS_NAME} != "osx" ]; then
exit 0
fi

brew update
brew install qt5
7 changes: 7 additions & 0 deletions scripts/travis_qmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ ${TRAVIS_OS_NAME} == "osx" ]; then
/usr/local/opt/qt5/bin/qmake
else
qmake
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(resorces);
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 858cfe8

Please sign in to comment.