progunit.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 = 0;
  32. qint64 mpid_launch;
  33. /* Start Count */
  34. int mnStartCount = 0;
  35. /* CPU */
  36. float mfCPU;
  37. /* Mem (Unit M)*/
  38. float mfMem;
  39. /* Thread Num */
  40. int mnThread;
  41. int state;//模块调度设定运行状态:0 停止,1 启动
  42. QTime timeRec;//当前时间
  43. int count;//次数
  44. bool mbSavestdout = false;
  45. unsigned long mnLastCPUTotal = 0;
  46. unsigned long mnLastProcTotal = 0;
  47. QProcess * mProcessGetpid;
  48. public:
  49. /* Get CPU Mem Thread */
  50. void UpdateResState();
  51. };
  52. #endif // PROGUNIT_H