Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cuteLib-hsrt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Glaser
cuteLib-hsrt
Commits
b9c6e7c6
Commit
b9c6e7c6
authored
2 months ago
by
tobiglaser
Browse files
Options
Downloads
Patches
Plain Diff
various minor fixes and improvements
parent
c4c27268
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
examples/studiMain.cpp
+11
-1
11 additions, 1 deletion
examples/studiMain.cpp
include/cute.h
+10
-12
10 additions, 12 deletions
include/cute.h
src/control.cpp
+5
-1
5 additions, 1 deletion
src/control.cpp
src/mainWindow.cpp
+1
-0
1 addition, 0 deletions
src/mainWindow.cpp
with
27 additions
and
14 deletions
examples/studiMain.cpp
+
11
−
1
View file @
b9c6e7c6
...
...
@@ -129,6 +129,16 @@ void bubblesort()
cute
::
resetPlot
(
0
);
cute
::
setPlotScale
(
0
,
cute
::
linear
,
cute
::
linear
);
cute
::
plotValues
(
data
);
cute
::
setLegendVisible
(
0
,
false
);
cute
::
setPlotVisible
(
1
,
false
);
cute
::
setPlotVisible
(
2
,
true
);
cute
::
setPlotTitle
(
0
,
"Bubblesort"
);
cute
::
setPlotTitle
(
2
,
"Runtime"
);
cute
::
setAxisVisible
(
0
,
true
,
true
);
cute
::
setAxisVisible
(
2
,
true
,
true
);
cute
::
setAxisTitles
(
2
,
"Problem Size n"
,
"Time / us"
);
cute
::
setLegendVisible
(
2
,
false
);
cute
::
delay
(
5
);
cute
::
timerStart
();
while
(
did_change
&&
cute
::
ok
())
...
...
@@ -176,7 +186,7 @@ void bubblesort()
+
to_string
(
swaps
)
+
" swaps in "
+
to_string
(
cute
::
timerResult
().
count
())
+
"
m
s.
\n
"
;
+
"
u
s.
\n
"
;
cute
::
logMessage
(
s
);
//cute::addRuntime(data.size(), timer.result());
}
...
...
This diff is collapsed.
Click to expand it.
include/cute.h
+
10
−
12
View file @
b9c6e7c6
...
...
@@ -41,16 +41,6 @@ namespace cute
circle
,
rectangle
};
struct
PlotProperties
{
std
::
string
name
=
""
;
int
size
=
10
;
Color
color
=
{
0
,
0
,
0
,
0
};
LineStyle
line
=
solid
;
bool
onTop
=
false
;
bool
legend
=
true
;
Shape
shape
=
circle
;
};
namespace
Colors
{
constexpr
Color
none
=
{
0
,
0
,
0
,
0xFF
};
...
...
@@ -72,6 +62,16 @@ namespace cute
constexpr
Color
darkGray
=
{
0x80
,
0x80
,
0x80
,
0
};
constexpr
Color
lightGray
=
{
0xC0
,
0xC0
,
0xC0
,
0
};
}
// namespace Colors
struct
PlotProperties
{
std
::
string
name
=
""
;
int
size
=
10
;
Color
color
=
Colors
::
none
;
LineStyle
line
=
solid
;
bool
onTop
=
false
;
bool
legend
=
true
;
Shape
shape
=
circle
;
};
void
DYNAMIC
setPlotVisible
(
int
plot
,
bool
visible
=
true
);
void
DYNAMIC
setPlotTitle
(
int
plot
,
const
std
::
string
&
title
);
void
DYNAMIC
setPlotScale
(
int
plot
,
Scale
x
,
Scale
y
);
...
...
@@ -118,8 +118,6 @@ namespace cute
std
::
chrono
::
microseconds
DYNAMIC
timerResult
();
namespace
core
{
// These are for loading and unloading libcute.dll at runtime
...
...
This diff is collapsed.
Click to expand it.
src/control.cpp
+
5
−
1
View file @
b9c6e7c6
...
...
@@ -32,6 +32,8 @@ void Control::makeConnections()
connect
(
cc
,
&
CuteControl
::
s_setPlotScale
,
this
,
&
Control
::
setPlotScale
);
connect
(
cc
,
&
CuteControl
::
s_setPlotTheme
,
this
,
&
Control
::
setPlotTheme
);
connect
(
cc
,
&
CuteControl
::
s_setLegendVisible
,
this
,
&
Control
::
setLegendVisible
);
connect
(
cc
,
&
CuteControl
::
s_setAxisVisible
,
this
,
&
Control
::
setAxisVisible
);
connect
(
cc
,
&
CuteControl
::
s_setAxisTitles
,
this
,
&
Control
::
setAxisTitles
);
connect
(
cc
,
&
CuteControl
::
s_enableAutorun
,
this
,
&
Control
::
enableAutorun
);
connect
(
cc
,
&
CuteControl
::
s_setProblemSize
,
this
,
&
Control
::
setProblemSize
);
connect
(
cc
,
&
CuteControl
::
s_setProblemFile
,
this
,
&
Control
::
setProblemFile
);
...
...
@@ -327,8 +329,10 @@ void Control::plotBarSeries(QtCharts::QBarSeries* series, int plot, bool onTop,
for
(
auto
&&
axis
:
w
->
charts
[
plot
]
->
axes
())
{
if
(
axis
->
orientation
()
==
Qt
::
Horizontal
)
//if (axis->type() == QtCharts::QAbstractAxis::AxisTypeCategory)
{
axisX
->
setTitleVisible
(
axis
->
isTitleVisible
());
axisX
->
setTitleText
(
axis
->
titleText
());
axisX
->
setVisible
(
axis
->
isVisible
());
w
->
charts
[
plot
]
->
removeAxis
(
axis
);
axis
->
deleteLater
();
}
...
...
This diff is collapsed.
Click to expand it.
src/mainWindow.cpp
+
1
−
0
View file @
b9c6e7c6
...
...
@@ -116,6 +116,7 @@ void MainWindow::setupCharts()
QtCharts
::
QChart
*
c
=
new
QtCharts
::
QChart
();
charts
.
push_back
(
c
);
v
->
setChart
(
c
);
v
->
setRenderHint
(
QPainter
::
Antialiasing
);
QString
title
=
"Plot "
;
title
+=
std
::
to_string
(
i
).
c_str
();
c
->
setTitle
(
title
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment