Skip to content

Commit 836d9ca

Browse files
authored
Merge pull request #18 from vetlewi/master
Version 1.4.1
2 parents df4dc07 + 230024d commit 836d9ca

File tree

17 files changed

+470
-97
lines changed

17 files changed

+470
-97
lines changed

CMakeLists.txt

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
cmake_minimum_required(VERSION 3.21)
2+
project(Qkinz VERSION 1.4.1 LANGUAGES C CXX)
3+
4+
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt@5")
5+
6+
find_package(Threads REQUIRED)
7+
find_package(Qt5 REQUIRED COMPONENTS Core Widgets WebEngine WebEngineCore WebEngineWidgets)
8+
set(CMAKE_AUTOMOC ON)
9+
set(CMAKE_AUTORCC ON)
10+
set(CMAKE_AUTOUIC ON)
11+
12+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
13+
#set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
14+
endif()
15+
16+
# ---- Add source files ----
17+
set(headers
18+
${CMAKE_CURRENT_SOURCE_DIR}/src/global.h
19+
${CMAKE_CURRENT_SOURCE_DIR}/src/types.h
20+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/mainwindow.h
21+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/qcustomplot.h
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/rundialog.h
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/selectbeamform.h
24+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/selectfrontbackform.h
25+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/selecttargetform.h
26+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/include/selecttelescopeform.h
27+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/BetheBlock.h
28+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/BetheBlockComp.h
29+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/CustomPower.h
30+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/DickNorbury.h
31+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/FileSP.h
32+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/Iterative.h
33+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/LNScattering.h
34+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/RelScatter.h
35+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/Scattering.h
36+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/StoppingPower.h
37+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/Ziegler1985.h
38+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/include/ZieglerComp.h
39+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/AbstractFunction.h
40+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/Matrix.h
41+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/PolyD2.h
42+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/Polyfit.h
43+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/Polynomial.h
44+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/spline.h
45+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/include/Vector.h
46+
${CMAKE_CURRENT_SOURCE_DIR}/src/matter/include/Material.h
47+
${CMAKE_CURRENT_SOURCE_DIR}/src/matter/include/Particle.h
48+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/include/BatchReader.h
49+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/include/Runsystem.h
50+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/include/tablemakerhtml.h
51+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/include/worker.h
52+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/include/ame2012_mass_tables.h
53+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/include/ame2012_masses.h
54+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/include/excitation.h
55+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/include/ziegler1985_table.h
56+
)
57+
set(sources
58+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/mainwindow.cpp
59+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/qcustomplot.cpp
60+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/rundialog.cpp
61+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/selectbeamform.cpp
62+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/selectfrontbackform.cpp
63+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/selecttargetform.cpp
64+
${CMAKE_CURRENT_SOURCE_DIR}/src/gui/src/selecttelescopeform.cpp
65+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/BetheBlock.cpp
66+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/BetheBlockComp.cpp
67+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/CustomPower.cpp
68+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/DickNorbury.cpp
69+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/FileSP.cpp
70+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/Iterative.cpp
71+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/LNScattering.cpp
72+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/RelScatter.cpp
73+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/Scattering.cpp
74+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/StoppingPower.cpp
75+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/Ziegler1985.cpp
76+
${CMAKE_CURRENT_SOURCE_DIR}/src/kinematics/src/ZieglerComp.cpp
77+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/AbstractFunction.cpp
78+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/Matrix.cpp
79+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/PolyD2.cpp
80+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/Polyfit.cpp
81+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/Polynomial.cpp
82+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/spline.cpp
83+
${CMAKE_CURRENT_SOURCE_DIR}/src/math/src/Vector.cpp
84+
${CMAKE_CURRENT_SOURCE_DIR}/src/matter/src/Material.cpp
85+
${CMAKE_CURRENT_SOURCE_DIR}/src/matter/src/Particle.cpp
86+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/src/BatchReader.cpp
87+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/src/Runsystem.cpp
88+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/src/tablemakerhtml.cpp
89+
${CMAKE_CURRENT_SOURCE_DIR}/src/support/src/worker.cpp
90+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/src/ame2012_mass_tables.cpp
91+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/src/ame2012_masses.cpp
92+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/src/excitation.cpp
93+
${CMAKE_CURRENT_SOURCE_DIR}/src/tables/src/ziegler1985_table.cpp
94+
${CMAKE_CURRENT_SOURCE_DIR}/app/main.cpp
95+
)
96+
97+
qt5_add_resources(sources resources/resorces.qrc)
98+
99+
add_executable(${PROJECT_NAME} ${headers} ${sources})
100+
101+
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
102+
103+
target_include_directories(${PROJECT_NAME}
104+
PRIVATE
105+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
106+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/gui/include>
107+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/kinematics/include>
108+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/math/include>
109+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/matter/include>
110+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/support/include>
111+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/tables/include>
112+
)
113+
114+
target_link_libraries(${PROJECT_NAME}
115+
PUBLIC
116+
Qt5::Widgets
117+
Qt5::WebEngineCore
118+
Qt5::WebEngine
119+
Qt5::WebEngineWidgets
120+
)
121+
122+
set_target_properties(${PROJECT_NAME} PROPERTIES
123+
WIN32_EXECUTABLE ON
124+
MACOSX_BUNDLE ON
125+
)

Qkinz.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TEMPLATE = subdirs
2-
# CONFIG += ordered
2+
# CONFIG += ordered sdk_no_version_check
33

44
SUBDIRS = \
55
src \

app/app.pro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ OBJECTS_DIR = $$BUILDDIR/app
1212
MOC_DIR = $$BUILDDIR/app
1313
RCC_DIR = $$BUILDDIR/app
1414
UI_DIR = $$BUILDDIR/app
15-
15+
CONFIG += sdk_no_version_check
1616
macx {
17-
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.15
17+
QMAKE_MACOSX_DEPLOYMENT_TARGET = 14
1818
QMAKE_CXXFLAGS += -std=c++20 -O3
19-
LIBS += -dead_strip #-stdlib=libc++
19+
LIBS += -dead_strip
2020
ICON = ../resources/media/Qkinz.icns
2121
}
2222

defaults.pri

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ INCLUDEPATH += $$PWD/src \
44
$$PWD/src/math/include \
55
$$PWD/src/matter/include \
66
$$PWD/src/support/include \
7-
$$PWD/src/tables/include \
7+
$$PWD/src/tables/include \
88

99
SRC_DIR = $$PWD
1010

resources/text/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<body>
44

55
<p>
6-
<b>Qkinz v1.4.0</b>, Copyright (C) 2015-2023 University of Oslo.
6+
<b>Qkinz v1.4.1</b>, Copyright (C) 2015-2024 University of Oslo.
77
</p>
88
<p>
99
This program is free software: you can redistribute it and/or modify

src/gui/forms/mainwindow.ui

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>1024</width>
10-
<height>911</height>
9+
<width>1034</width>
10+
<height>1000</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -538,6 +538,61 @@
538538
</property>
539539
</widget>
540540
</item>
541+
<item>
542+
<widget class="QCheckBox" name="otherFrag">
543+
<property name="text">
544+
<string>Other</string>
545+
</property>
546+
</widget>
547+
</item>
548+
<item>
549+
<layout class="QHBoxLayout" name="LayoutFragOtherA">
550+
<item>
551+
<widget class="QLabel" name="OtherALabel">
552+
<property name="text">
553+
<string>A:</string>
554+
</property>
555+
</widget>
556+
</item>
557+
<item>
558+
<widget class="QSpinBox" name="otherA">
559+
<property name="minimum">
560+
<number>0</number>
561+
</property>
562+
<property name="maximum">
563+
<number>999</number>
564+
</property>
565+
<property name="value">
566+
<number>12</number>
567+
</property>
568+
</widget>
569+
</item>
570+
</layout>
571+
</item>
572+
<item>
573+
<layout class="QHBoxLayout" name="LayoutFragOtherZ">
574+
<item>
575+
<widget class="QLabel" name="OtherZLabel">
576+
<property name="text">
577+
<string>Z:</string>
578+
</property>
579+
</widget>
580+
</item>
581+
<item>
582+
<widget class="QSpinBox" name="otherZ">
583+
<property name="minimum">
584+
<number>0</number>
585+
</property>
586+
<property name="maximum">
587+
<number>999</number>
588+
</property>
589+
<property name="value">
590+
<number>6</number>
591+
</property>
592+
</widget>
593+
</item>
594+
</layout>
595+
</item>
541596
<item>
542597
<spacer name="verticalSpacer_3">
543598
<property name="orientation">
@@ -673,8 +728,8 @@
673728
</attribute>
674729
<layout class="QGridLayout" name="gridLayout_2">
675730
<item row="0" column="0">
676-
<widget class="QWebEngineView" name="webView" native="true">
677-
<property name="url" stdset="0">
731+
<widget class="QWebEngineView" name="webView">
732+
<property name="url">
678733
<url>
679734
<string>about:blank</string>
680735
</url>
@@ -694,8 +749,8 @@
694749
<rect>
695750
<x>0</x>
696751
<y>0</y>
697-
<width>1024</width>
698-
<height>22</height>
752+
<width>1034</width>
753+
<height>37</height>
699754
</rect>
700755
</property>
701756
<widget class="QMenu" name="menuFile">
@@ -805,15 +860,15 @@
805860
<layoutdefault spacing="6" margin="11"/>
806861
<customwidgets>
807862
<customwidget>
808-
<class>QCustomPlot</class>
863+
<class>QWebEngineView</class>
809864
<extends>QWidget</extends>
810-
<header>qcustomplot.h</header>
811-
<container>1</container>
865+
<header location="global">QtWebEngineWidgets/QWebEngineView</header>
812866
</customwidget>
813867
<customwidget>
814-
<class>QWebEngineView</class>
868+
<class>QCustomPlot</class>
815869
<extends>QWidget</extends>
816-
<header>qwebengineview.h</header>
870+
<header>qcustomplot.h</header>
871+
<container>1</container>
817872
</customwidget>
818873
</customwidgets>
819874
<resources>

src/gui/include/mainwindow.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ class MainWindow : public QMainWindow
3737

3838
signals:
3939
//void operate(const double &Angle, const bool &p, const bool &d, const bool &t, const bool &h3, const bool &a);
40-
void operate(const double &Angle, const double &incAngle, const bool &p, const bool &d, const bool &t, const bool &h3, const bool &a);
40+
void operate(const double &Angle, const double &incAngle, const bool &p, const bool &d, const bool &t, const bool &h3, const bool &a, const int &A, const int &Z);
4141
void runBatchFile(QString batchfile);
4242

4343
public slots:
4444
//! Slot for reciving curve data from the worker. It will plot the data for the
4545
//! recived data.
46-
void CurveData(const QVector<double> &x, /*!< x-values. */
46+
void CurveData(const QVector<double> &ex, /*!< Excitation energy. */
47+
const QVector<double> &x, /*!< x-values. */
4748
const QVector<double> &y, /*!< y-values. */
4849
const QVector<double> &coeff, /*!< Coefficients for the fit Ex(x+y) = a0 + a1(x+y) + a2(x+y)^2 */
4950
const Fragment_t &what /*!< What fragment. */);
@@ -142,6 +143,9 @@ private slots:
142143
//! Angle ratio button is toggled.
143144
void toggle_Angle(bool);
144145

146+
//! Toggle the 'Other' option.
147+
void toggle_frag(bool);
148+
145149
private:
146150
//! The ui of the window.
147151
Ui::MainWindow *ui;

src/gui/include/qcustomplot.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
****************************************************************************
2020
** Author: Emanuel Eichhammer **
2121
** Website/Contact: http://www.qcustomplot.com/ **
22-
** Date: 25.04.15 **
23-
** Version: 1.3.1 **
22+
** Date: 22.12.15 **
23+
** Version: 1.3.2 **
2424
****************************************************************************/
2525

2626
#ifndef QCUSTOMPLOT_H
@@ -51,7 +51,7 @@
5151
# include <QPrintEngine>
5252
#else
5353
# include <QtNumeric>
54-
# include <QtPrintSupport>
54+
# include <QtPrintSupport/QtPrintSupport>
5555
#endif
5656

5757
class QCPPainter;
@@ -3615,6 +3615,7 @@ class QCP_LIB_DECL QCPItemPixmap : public QCPAbstractItem
36153615
QPixmap mPixmap;
36163616
QPixmap mScaledPixmap;
36173617
bool mScaled;
3618+
bool mScaledPixmapInvalidated;
36183619
Qt::AspectRatioMode mAspectRatioMode;
36193620
Qt::TransformationMode mTransformationMode;
36203621
QPen mPen, mSelectedPen;

0 commit comments

Comments
 (0)