main.cpp 855 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3. #include <iostream>
  4. #include "xmlparam.h"
  5. #include "ivlog.h"
  6. #include "ivfault.h"
  7. iv::Ivlog * givlog;
  8. iv::Ivfault * givfault;
  9. std::string gstrmemname;
  10. static std::string gstrmodulename;
  11. int main(int argc, char *argv[])
  12. {
  13. QApplication a(argc, argv);
  14. QString strpath = QCoreApplication::applicationDirPath();
  15. if(argc < 2)
  16. strpath = strpath + "/sample1.xml";
  17. else
  18. strpath = argv[1];
  19. std::cout<<strpath.toStdString()<<std::endl;
  20. iv::xmlparam::Xmlparam xp(strpath.toStdString());
  21. gstrmodulename = xp.GetParam("modulename","sample1");
  22. gstrmemname = xp.GetParam("msgname","sample1");
  23. givlog = new iv::Ivlog(gstrmodulename.data());
  24. givfault = new iv::Ivfault(gstrmodulename.data());
  25. // strmodulename =
  26. MainWindow w;
  27. w.show();
  28. return a.exec();
  29. }