Added timing logging to start/stop display, not just timed exposure

This commit is contained in:
Matt McWilliams 2024-05-14 20:23:09 -04:00
parent 8d6e1a8f67
commit 58f0d17779
1 changed files with 5 additions and 1 deletions

View File

@ -60,6 +60,7 @@ void actionDisplay () {
displaying = true; displaying = true;
completed = true; completed = true;
timing = false; timing = false;
startTime = steady_clock::now();
} else if (exposure.size() == 1) { } else if (exposure.size() == 1) {
exposureTime = exposure[0]; exposureTime = exposure[0];
displaying = true; displaying = true;
@ -72,6 +73,9 @@ void actionDisplay () {
void actionStop () { void actionStop () {
displaying = false; displaying = false;
completed = true; completed = true;
auto currentTime = steady_clock::now();
auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count();
cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : null }" << endl;
} }
void postAction () { void postAction () {
@ -163,7 +167,7 @@ void display () {
if (displaying && timing) { if (displaying && timing) {
auto currentTime = steady_clock::now(); auto currentTime = steady_clock::now();
auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count(); auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count();
if (elapsedTime > exposureTime) { if (elapsedTime >= exposureTime) {
cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : " << exposureTime << " }" << endl; cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : " << exposureTime << " }" << endl;
displaying = false; displaying = false;
timing = false; timing = false;