|
@@ -492,6 +492,17 @@ void DatabaseThread::run()
|
|
|
db.close();
|
|
|
}
|
|
|
|
|
|
+ if(QDateTime::currentDateTime().time().hour() != hour){
|
|
|
+ printf("enter initDb\n");
|
|
|
+ hour = QDateTime::currentDateTime().time().hour();
|
|
|
+ if(!db.open())
|
|
|
+ {
|
|
|
+ db.open();
|
|
|
+ }
|
|
|
+ initDb();
|
|
|
+ db.close();
|
|
|
+ }
|
|
|
+
|
|
|
int devcount = 0;
|
|
|
QString St,Et;
|
|
|
if(devAlarmList.length()>0){
|
|
@@ -535,11 +546,6 @@ void DatabaseThread::run()
|
|
|
count++;
|
|
|
db.open();
|
|
|
}else{
|
|
|
- if(QDateTime::currentDateTime().time().hour() != hour){
|
|
|
- printf("enter initDb\n");
|
|
|
- hour = QDateTime::currentDateTime().time().hour();
|
|
|
- initDb();
|
|
|
- }
|
|
|
|
|
|
count=0;
|
|
|
while(sqlList.length()>0){
|