-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
64 lines (52 loc) · 1.29 KB
/
main.cpp
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
#include "dialog.h"
#include <QApplication>
#include <QTextCodec>
bool use_trigger_mode = false;
char recv_buffer[1024*1024];
// class ServerThread : public QThread {
// protected:
// virtual void run() {
// _pm_main();
// }
// };
void printUsage()
{
qDebug() << "Usage: PMPackedGUI [options]";
qDebug() << "options: --help show this help";
qDebug() << " --trigger-mode use trigger mode, some cameras may not support";
}
bool checkArgs(int argc, char* argv[])
{
for(int i = 1; i < argc; i++)
{
if(!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")){
return false;
}
if(!strcmp(argv[i], "--trigger-mode")){
use_trigger_mode = true;
}
}
if(use_trigger_mode){
qDebug() << "Set to use trigger mode";
} else {
qDebug() << "Set to use continuous mode";
}
return true;
}
int main(int argc, char *argv[])
{
if(!checkArgs(argc, argv)){
printUsage();
return 0;
}
QApplication a(argc, argv);
QTextCodec::setCodecForLocale(QTextCodec::codecForLocale());
Dialog w;
w.show();
// #ifdef BUILD_STATIC
// // Create a new thread to run server
// ServerThread thread;
// thread.start();
// #endif
return a.exec();
}