Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Richard Lin
qtquick3d
Commits
25a17fd3
Commit
25a17fd3
authored
Oct 16, 2020
by
Tomi Korpipää
Browse files
Improve report file name in benchmark demo
parent
e3c0e37c
Changes
8
Hide whitespace changes
Inline
Side-by-side
BenchmarkDemo/BenchmarkUI/CommandlineParser.qml
View file @
25a17fd3
...
...
@@ -40,6 +40,7 @@ Item {
// Other parameters to be read from the outside
property
bool
quitAfter
:
false
property
string
commandlineArgumentsString
:
""
signal
parsingDone
signal
startBenchmark
...
...
@@ -97,6 +98,7 @@ Item {
for
(
var
i
=
1
;
i
<
commandLineArguments
.
length
;
i
+=
2
)
{
switch
(
commandLineArguments
[
i
])
{
case
"
--preset
"
:
commandlineArgumentsString
+=
commandLineArguments
[
i
+
1
]
+
"
_
"
;
parser
.
presetMidrange
=
false
;
switch
(
commandLineArguments
[
i
+
1
])
{
case
"
entrylevel
"
:
...
...
@@ -114,6 +116,7 @@ Item {
break
;
case
"
--target
"
:
parser
.
targetDesktop
=
false
;
commandlineArgumentsString
+=
commandLineArguments
[
i
+
1
]
+
"
_
"
;
switch
(
commandLineArguments
[
i
+
1
])
{
case
"
embedded
"
:
parser
.
targetEmbedded
=
true
;
...
...
@@ -161,6 +164,7 @@ Item {
break
;
case
"
--automatic
"
:
autoModeEnabled
=
true
;
commandlineArgumentsString
+=
commandLineArguments
[
i
+
1
]
+
"
_
"
;
switch
(
commandLineArguments
[
i
+
1
])
{
case
"
model
"
:
parser
.
autoModel
=
true
;
...
...
BenchmarkDemo/BenchmarkUI/DemoScene.ui.qml
View file @
25a17fd3
...
...
@@ -1713,8 +1713,10 @@ Item {
view3D
.
environment
.
effects
=
effectList
;
}
if
(
commands
.
modeBenchmark
)
if
(
commands
.
modeBenchmark
)
{
logger
.
singleReportMode
=
commands
.
reportSingle
;
logger
.
settingsString
=
commands
.
commandlineArgumentsString
;
}
// Force changing the env once to enable all state changed (bit unclear why this is needed, though)
view3D
.
environment
=
sceneEnvironmentIBL
;
...
...
BenchmarkDemo/BenchmarkUI/Logger.qml
View file @
25a17fd3
...
...
@@ -46,16 +46,22 @@ Item {
// script file name in case of script testing
property
string
scriptName
:
""
// additional report name string
property
string
settingsString
:
""
function
start
(
view
)
{
var
date
=
new
Date
().
toLocaleDateString
(
Qt
.
locale
(
"
en_EN
"
),
"
yyyy-MM-dd-
"
);
var
time
=
new
Date
().
toLocaleTimeString
(
Qt
.
locale
(
"
en_EN
"
),
"
hh-mm-ss
"
);
if
(
!
singleReportMode
)
{
logUrl
=
"
file:./benchmark_result_
"
+
date
+
time
+
"
.txt
"
;
}
else
if
(
singleReportMode
&&
logUrl
.
length
===
0
)
{
if
(
scriptName
.
length
>
0
)
if
(
scriptName
.
length
>
0
)
{
logUrl
=
"
file:./
"
+
scriptName
+
"
_
"
+
date
+
time
+
"
.txt
"
;
else
logUrl
=
"
file:./
"
+
"
benchmark_result_automatic_
"
+
date
+
time
+
"
.txt
"
;
}
else
{
logUrl
=
"
file:./
"
+
"
benchmark_result_automatic_
"
+
settingsString
+
date
+
time
+
"
.txt
"
;
}
}
source
=
view
;
measureTimer
.
start
();
...
...
BenchmarkDemo/BenchmarkUI/assets/Model1k.qml
View file @
25a17fd3
...
...
@@ -28,7 +28,7 @@ Node {
y
:
0.510341
z
:
-
1.45991
eulerRotation.x
:
-
180
eulerRotation.z
:
rootNode
.
gearRotation
eulerRotation.z
:
rootNode
.
gearRotation
+
25
source
:
"
meshes/gear.mesh
"
materials
:
[
...
...
BenchmarkDemoQt6/BenchmarkUI/CommandlineParser.qml
View file @
25a17fd3
...
...
@@ -40,6 +40,7 @@ Item {
// Other parameters to be read from the outside
property
bool
quitAfter
:
false
property
string
commandlineArgumentsString
:
""
signal
parsingDone
signal
startBenchmark
...
...
@@ -97,6 +98,7 @@ Item {
for
(
var
i
=
1
;
i
<
commandLineArguments
.
length
;
i
+=
2
)
{
switch
(
commandLineArguments
[
i
])
{
case
"
--preset
"
:
commandlineArgumentsString
+=
commandLineArguments
[
i
+
1
]
+
"
_
"
;
parser
.
presetMidrange
=
false
;
switch
(
commandLineArguments
[
i
+
1
])
{
case
"
entrylevel
"
:
...
...
@@ -114,6 +116,7 @@ Item {
break
;
case
"
--target
"
:
parser
.
targetDesktop
=
false
;
commandlineArgumentsString
+=
commandLineArguments
[
i
+
1
]
+
"
_
"
;
switch
(
commandLineArguments
[
i
+
1
])
{
case
"
embedded
"
:
parser
.
targetEmbedded
=
true
;
...
...
@@ -161,6 +164,7 @@ Item {
break
;
case
"
--automatic
"
:
autoModeEnabled
=
true
;
commandlineArgumentsString
+=
commandLineArguments
[
i
+
1
]
+
"
_
"
;
switch
(
commandLineArguments
[
i
+
1
])
{
case
"
model
"
:
parser
.
autoModel
=
true
;
...
...
BenchmarkDemoQt6/BenchmarkUI/DemoScene.ui.qml
View file @
25a17fd3
...
...
@@ -1738,8 +1738,10 @@ Item {
view3D
.
environment
.
effects
=
effectList
;
}
if
(
commands
.
modeBenchmark
)
if
(
commands
.
modeBenchmark
)
{
logger
.
singleReportMode
=
commands
.
reportSingle
;
logger
.
settingsString
=
commands
.
commandlineArgumentsString
;
}
// Force changing the env once to enable all state changed (bit unclear why this is needed, though)
view3D
.
environment
=
sceneEnvironmentIBL
;
...
...
BenchmarkDemoQt6/BenchmarkUI/Logger.qml
View file @
25a17fd3
...
...
@@ -46,16 +46,22 @@ Item {
// script file name in case of script testing
property
string
scriptName
:
""
// additional report name string
property
string
settingsString
:
""
function
start
(
view
)
{
var
date
=
new
Date
().
toLocaleDateString
(
Qt
.
locale
(
"
en_EN
"
),
"
yyyy-MM-dd-
"
);
var
time
=
new
Date
().
toLocaleTimeString
(
Qt
.
locale
(
"
en_EN
"
),
"
hh-mm-ss
"
);
if
(
!
singleReportMode
)
{
logUrl
=
"
file:./benchmark_result_
"
+
date
+
time
+
"
.txt
"
;
}
else
if
(
singleReportMode
&&
logUrl
.
length
===
0
)
{
if
(
scriptName
.
length
>
0
)
if
(
scriptName
.
length
>
0
)
{
logUrl
=
"
file:./
"
+
scriptName
+
"
_
"
+
date
+
time
+
"
.txt
"
;
else
logUrl
=
"
file:./
"
+
"
benchmark_result_automatic_
"
+
date
+
time
+
"
.txt
"
;
}
else
{
logUrl
=
"
file:./
"
+
"
benchmark_result_automatic_
"
+
settingsString
+
date
+
time
+
"
.txt
"
;
}
}
source
=
view
;
measureTimer
.
start
();
...
...
BenchmarkDemoQt6/BenchmarkUI/assets/Model1k.qml
View file @
25a17fd3
...
...
@@ -28,7 +28,7 @@ Node {
y
:
0.510341
z
:
-
1.45991
eulerRotation.x
:
-
180
eulerRotation.z
:
rootNode
.
gearRotation
eulerRotation.z
:
rootNode
.
gearRotation
+
25
source
:
"
meshes/gear.mesh
"
materials
:
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment