Commit 25a17fd3 authored by Tomi Korpipää's avatar Tomi Korpipää
Browse files

Improve report file name in benchmark demo

parent e3c0e37c
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
......@@ -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: [
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
......@@ -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: [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment