testshmsend.cpp 488 B

1234567891011121314151617181920
  1. #include "testshmsend.h"
  2. testshmsend::testshmsend()
  3. {
  4. mpa = new iv::modulecommext::modulecommmsg<iv::testmodulecommext>();
  5. mpa->RegisterSend("test",1000,1,iv::modulecomm::ModuleComm_SHAREMEM);
  6. }
  7. void testshmsend::run()
  8. {
  9. while (!QThread::isInterruptionRequested()) {
  10. iv::testmodulecommext xmsg;
  11. xmsg.set_a(1);
  12. xmsg.set_b(2);
  13. xmsg.set_time(QDateTime::currentMSecsSinceEpoch());
  14. mpa->ModuleSendMsg(xmsg);
  15. msleep(1000);
  16. }
  17. }