progunit.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef PROGUNIT_H
  2. #define PROGUNIT_H
  3. #include <QProcess>
  4. #include <QThread>
  5. #include <vector>
  6. #include <QtXml>
  7. // Used For Program Monitor
  8. #include "cpumem.h"
  9. #include "QtDBus/QDBusMessage"
  10. #include "QtDBus/QDBusConnection"
  11. class ProgUnit
  12. {
  13. public:
  14. /* Launch Name */
  15. std::string strlaunch;
  16. /* App Directory */
  17. std::string strappdir;
  18. /* App modulename */
  19. std::string strmodulename;
  20. /* Is Auto Start */
  21. bool mbautostart;
  22. /* App Execution Command */
  23. std::string strcmd;
  24. /* Group Name */
  25. std::string strgroup;
  26. /* Process */
  27. QProcess * mProcess;
  28. /* run state */
  29. bool mbRun = false;
  30. /* processid */
  31. qint64 mpid;
  32. /* Start Count */
  33. int mnStartCount = 0;
  34. /* CPU */
  35. float mfCPU;
  36. /* Mem (Unit M)*/
  37. float mfMem;
  38. /* Thread Num */
  39. int mnThread;
  40. int state;//模块调度设定运行状态:0 停止,1 启动
  41. QTime timeRec;//当前时间
  42. int count;//次数
  43. bool mbSavestdout = false;
  44. unsigned long mnLastCPUTotal = 0;
  45. unsigned long mnLastProcTotal = 0;
  46. public:
  47. /* Get CPU Mem Thread */
  48. void UpdateResState();
  49. };
  50. #endif // PROGUNIT_H