-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisiontime.h
More file actions
75 lines (62 loc) · 1.64 KB
/
visiontime.h
File metadata and controls
75 lines (62 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* @file visiontime.h
* @version 1.2
* @brief C++ Interface: visiontime
*
* @details A tool designed for measuring robot computer vision performance + analyze & sum up results
*
* Copyright: See COPYING file that comes with this distribution
*
*/
#ifndef VISIONTIME
#define VISIONTIME
#include <iostream>
#include <sys/time.h>
#include <QFile>
#include <QString>
#include <QDateTime>
#include <QTextStream>
#include <QVector>
#include <QMutex>
class VisionTime
{
public:
static VisionTime * DO();
void turnOn();
void setMeasureNumberOfFrames(int frameNumber);
void setStartMeasuringFromFrame(int frameNumber);
void newFrame();
/**
* @brief Mark the begin of the first event.
*/
void markBegin(const std::string & );
/**
* @brief Mark the end of the second event.
*/
void markEnd(const std::string& );
~VisionTime();
private:
VisionTime(); //constructor is private
static VisionTime* visionTimerInstance; //creates a pointer to an instance of Timer
static bool turnedOn;
bool measure;
timespec begin, end, temp, moment;
QFile* file;
QTextStream* out;
int startMeasuringFrame, currentFrame, measureNrOfFrames, finalFrame;
/**
* @brief Begin saveing the measuring results to file.
*/
void beginSaveToFile();
/**
* @brief End saving the measuring results to file.
*/
void endSaveToFile();
int nanoDifference(int begin, int end);
void CalculateResults();
void printMeasurementsData(int numberOfRecords);
QVector<long> timeMemory;
QVector<std::string> procMemory;
QMutex memoryMutex;
};
#endif // VisionTime