-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcountpanel.h
132 lines (107 loc) · 2.84 KB
/
countpanel.h
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef COUNTPANEL_H
#define COUNTPANEL_H
#include <QMainWindow>
#include <QListWidget>
#include <QTableWidget>
#include <QSplitter>
#include <QRadioButton>
#include <QGroupBox>
#include <QTimer>
#include <QFile>
#include <QMutex>
#include "Utilities/paneldialog.h"
#include "Utilities/directorysetter.h"
#include "Utilities/numbertextbox.h"
#include "Filters/darknet.h"
#include "alarmpanel.h"
class ObjDrawer : public QWidget
{
Q_OBJECT
public:
ObjDrawer(QMainWindow *parent, int obj_id);
QString getButtonStyle() const;
QString getSettingsKey() const;
QString saveState() const;
void restoreState(const QString& arg);
void signalShown(int obj_id, const YUVColor& color);
QMainWindow *mainWindow;
QCheckBox *chkShow;
QPushButton *btnColor;
int obj_id;
QColor color;
bool show = false;
const QString seperator = "\n";
signals:
void shown(int, const YUVColor&);
void colored(int, const YUVColor&);
public slots:
void chkShowClicked(bool);
void btnColorClicked();
};
class AlarmSetter : public QWidget
{
Q_OBJECT
public:
AlarmSetter(QMainWindow *parent, int obj_id);
QMainWindow *mainWindow;
QPushButton *button;
int obj_id;
AlarmDialog *alarmDialog;
public slots:
void buttonPressed();
};
class CountPanel : public Panel
{
Q_OBJECT
public:
CountPanel(QMainWindow *parent);
~CountPanel();
void autoSave() override;
int indexForSums(int obj_id);
int indexForCounts(int obj_id);
int rowOf(int obj_id);
int idFromName(const QString& name);
void addNewLine(int obj_id);
void removeLine(int obj_id);
QString getTimestampFilename() const;
void addCount(int obj_id, int count);
QStringList names;
QListWidget *list;
QTableWidget *table;
QSplitter *hSplit;
DirectorySetter *dirSetter;
NumberTextBox *txtInterval;
QWidget *intervalPanel;
QCheckBox *saveOn;
QTimer *timer;
QFile *file = nullptr;
Darknet *darknet;
const QString headerKey = "CountPanel/header";
const QString hSplitKey = "CountPanel/hSplit";
const QString dirKey = "CountPanel/dir";
const QString intervalKey = "CountPanel/interval";
const QString groupBoxKey = "CountPanel/groupBox";
const QString saveOnKey = "CountPanel/saveOn";
vector<pair<int, int>> sums;
vector<pair<int, vector<int>>> counts;
QMutex mutex;
public slots:
void itemChanged(QListWidgetItem*);
void itemClicked(QListWidgetItem*);
void hSplitMoved(int, int);
void feed(vector<bbox_t>*);
void headerChanged(int, int, int);
void setDir(const QString&);
void saveOnClicked(bool);
void intervalEdited();
void timeout();
void shutdown();
void setNames();
};
class CountDialog : public PanelDialog
{
Q_OBJECT
public:
CountDialog(QMainWindow *parent);
};
#endif // COUNTPANEL_H