-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstant.cpp
More file actions
82 lines (60 loc) · 2.84 KB
/
Copy pathconstant.cpp
File metadata and controls
82 lines (60 loc) · 2.84 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
76
77
78
79
80
81
#include "constant.h"
//const QString HEART_BEAT_URL=QString::fromLocal8Bit("http://119.23.151.219/api/Cisdi.ashx?method=GetUrlAll&Number=0");
//const QString DOWNLOAD_PIC_URL_PRE="http://119.23.151.219/UpLoad/";
//const QString SEND_SIGN_IN_MESSAGE_URL="http://119.23.151.219/api/Cisdi.ashx?method=ClockData";
//ʾÀý http://119.23.151.219/api/Cisdi.ashx?method=ClockData&Name=ÂÀÔÆåÐ&UserId=350&Type=true&Department=24&Work=true
QString Constant::SERVER_URL="";
QString Constant::HEART_BEAT_URL="";
QString Constant::DOWNLOAD_PIC_URL_PRE="";
QString Constant::SEND_SIGN_IN_MESSAGE_URL="";
bool Constant::SAVE_DISCERN=false;
void Constant::Read_Configuration(){
// qDebug()<<QDir::currentPath();
QDomDocument doc;
QFile file(QDir::currentPath()+QString::fromLocal8Bit("/config/config.xml"));
QString error = "";
int row = 0, column = 0;
if (!file.open(QIODevice::ReadOnly)) return ;
if(!doc.setContent(&file, false, &error, &row, &column)){
qDebug() << "parse file failed:" << row << "---" << column <<":" <<error;
file.close();
return ;
}
file.close();
QDomElement root = doc.documentElement();
QDomNode node = root.firstChild();
while(!node.isNull()) {
QDomElement element = node.toElement(); // try to convert the node to an element.
if(element.tagName()==(QString::fromLocal8Bit("SERVER_ADDRESS"))){
if(!element.text().isNull()){
SERVER_URL=element.text();
}
}
if(element.tagName()==(QString::fromLocal8Bit("SAVE_DISCERN"))){
if(!element.text().isNull()){
QVariant tempValue=element.text();
Constant::SAVE_DISCERN=tempValue.toBool();
}
}
node = node.nextSibling();
}
if(Constant::SERVER_URL.isEmpty()){
Constant::SERVER_URL=QString::fromLocal8Bit("http://119.23.151.219");
}
Constant::HEART_BEAT_URL=Constant::SERVER_URL+QString::fromLocal8Bit("/api/Cisdi.ashx?method=GetUrlAll&Number=0");
Constant::DOWNLOAD_PIC_URL_PRE=Constant::SERVER_URL+QString::fromLocal8Bit("/UpLoad/");
Constant::SEND_SIGN_IN_MESSAGE_URL=Constant::SERVER_URL+QString::fromLocal8Bit("/api/Cisdi.ashx?method=ClockData");
// qDebug()<<"1SAVE_DISCERN:"<<Constant::SAVE_DISCERN;
// qDebug()<<HEART_BEAT_URL;
// qDebug()<<DOWNLOAD_PIC_URL_PRE;
// qDebug()<<SEND_SIGN_IN_MESSAGE_URL;
return ;
}
const QString FACE_DB_CONNECTION_NAME="FACE_DB_CONNECTION_NAME";
const QString HEART_DB_CONNECTION_NAME="HEART_DB_CONNECTION_NAME";
const QString UI_DB_CONNECTION_NAME="UI_DB_CONNECTION_NAME";
const unsigned int BEAT_CIRCLE=5000;
const unsigned int SCREEN_SHOT_CIRCLE=200;
const unsigned int MAIN_WIDGET_WIDTH=1920;
const unsigned int MAIN_WIDGET_HEIGHT=1080;
const unsigned int CLEAR_SIGN_CACHE_INTERVAL=60000;//60sÇå¿ÕÒ»´Î