/[kvoss_old]/kvsvv/trunk/src/xmlFileConvert.cpp
ViewVC logotype

Diff of /kvsvv/trunk/src/xmlFileConvert.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3718 by terjeer, Wed Jan 4 12:20:19 2012 UTC revision 3719 by glennb, Mon Jul 23 10:26:26 2012 UTC
# Line 13  Fileconvert::Fileconvert(QWidget *parent Line 13  Fileconvert::Fileconvert(QWidget *parent
13      //filehandling = new Filehandling(convertPath,opdataPath,station); kommentert ut 4/4-2011      //filehandling = new Filehandling(convertPath,opdataPath,station); kommentert ut 4/4-2011
14    
15          //Filehandling *filehandling = new Filehandling(convertPath,opdataPath,"");          //Filehandling *filehandling = new Filehandling(convertPath,opdataPath,"");
16      Filehandling filehandling(convertPath,opdataPath,"");      QSettings settings("svvxml2kvalobssvv");
17        qDebug() << "opdataPath Settings:" <<  settings.value("opdataPath").toString();
18        qDebug() << "kvalobsfilePath Settings:" <<  settings.value("kvalobsfilePath").toString();
19        qDebug() << "kvalobsfilePath Settings:" <<  settings.value("databaseName").toString();
20        qDebug() << "kvalobsfilePath Settings:" <<  settings.value("databaseIp").toString();
21        qDebug() << "kvalobsfilePath Settings:" <<  settings.value("port").toString();
22        opdataPath = settings.value("opdataPath").toString();
23        convertPath = settings.value("kvalobsfilePath").toString();
24        databaseName = settings.value("databaseName").toString();
25        databaseIp = settings.value("databaseIp").toString();
26        port = settings.value("port").toString();
27        /*Filehandling filehandling(convertPath,opdataPath,"");
28      opdataPath = filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","opdataPath");      opdataPath = filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","opdataPath");
29      convertPath = filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","kvalobsfilePath");      convertPath = filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","kvalobsfilePath");
30      databaseName =filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","databaseName");      databaseName =filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","databaseName");
31      databaseIp=filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","databaseIp");      databaseIp=filehandling.findStringInFile("/etc/svvxml2kvalobssvv/svvxml2kvalobssvv.conf","databaseIp");    */ // komentert ut
32    
33      qDebug() <<"convertPath :" <<convertPath;      qDebug() <<"convertPath :" <<convertPath;
34      qDebug() <<"opdataPath :" <<opdataPath;      qDebug() <<"opdataPath :" <<opdataPath;
35      qDebug() <<" databaseName :" << databaseName;      qDebug() <<" databaseName :" << databaseName;
36      qDebug() <<" databaseIp :" << databaseIp;      qDebug() <<" databaseIp :" << databaseIp;
37        qDebug() <<" port :" << port;
38      xmlLogFile = "xmlLog.txt";      xmlLogFile = "xmlLog.txt";
39      xmlLogFile.prepend(convertPath);      xmlLogFile.prepend(convertPath);
40    
# Line 88  void Fileconvert::runScript(Filehandling Line 99  void Fileconvert::runScript(Filehandling
99          QStringList liste = findFilesToSend(filehandling);          QStringList liste = findFilesToSend(filehandling);
100    
101          liste.sort();   //sortert med eldste filer først          liste.sort();   //sortert med eldste filer først
102    
103    
104          QString logFile = "kvalobslog.txt";          QString logFile = "kvalobslog.txt";
105          logFile.prepend(convertPath);          logFile.prepend(convertPath);
# Line 284  QString Fileconvert::convertFiles(QStrin Line 295  QString Fileconvert::convertFiles(QStrin
295    
296          for(int i=0 ; i <files.size() ; i++)          for(int i=0 ; i <files.size() ; i++)
297          {          {
298                  qDebug() <<" i løkke?: ";                  //qDebug() <<" i løkke?: ";
299                  QString file1 = files[i];                  QString file1 = files[i];
300                  if(!filehandling.isStringInFile(file1,xmlLogFile)){                  if(!filehandling.isStringInFile(file1,xmlLogFile)){
301                            /*if(file1.startsWith("20120112")){
302                                    qDebug() << file1 << " er ikke i : " << xmlLogFile;
303                            }*/
304                          file1.prepend(opdataPath);                          file1.prepend(opdataPath);
305                          convertSvvXml(file1);                          convertSvvXml(file1);
306                  }                  }
307          }          }
308    
# Line 308  void Fileconvert::convertSvvXml(QString Line 322  void Fileconvert::convertSvvXml(QString
322      Deretter kjøres XQueries*/      Deretter kjøres XQueries*/
323      //qDebug() <<" i convertSvvXml :" << fileName <<"\n";      //qDebug() <<" i convertSvvXml :" << fileName <<"\n";
324      //qDebug() <<" convertPath : " <<convertPath;      //qDebug() <<" convertPath : " <<convertPath;
325      XmlStreamReader reader(convertPath,xmlLogFile,databaseName,databaseIp);      XmlStreamReader reader(convertPath,xmlLogFile,databaseName,databaseIp,port);
326      reader.readFile(fileName);      reader.readFile(fileName);
327      reader.XQueries(fileName);      reader.XQueries(fileName);
328  }  }

Legend:
Removed from v.3718  
changed lines
  Added in v.3719

svn@met.no
ViewVC Help
Powered by ViewVC 1.1.5