Results 1 to 4 of 4

Thread: watchdog timer implementation based on QTimer

  1. #1
    Join Date
    Dec 2008
    Posts
    32
    Thanks
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default watchdog timer implementation based on QTimer

    Hello!
    Here is the problem:
    I'm trying to implement a watchdogtimer-like behavior of Motion-Detection software.

    1. When we recieve first MOTION-signal, we start video capturing and QTimer, which connected to stopVideoCapture().
    2. If we don't recieve any MOTION-signal while timer is active, then stopVideoCapture() is called - and all done.
    2a. But if we recieve another MOTION-signal, we need to restart timer to prolongate video capturing process... but I get stuck here - don't understand how to reset QTimer....
    Qt Code:
    1. timer->stop();
    2. timer->start(15000);
    To copy to clipboard, switch view to plain text mode 

    won't work because stopVideoCapture() is called after 15 sec from initial timer->start() no matter how many MOTION-signals were recieved within that interval...

    Any suggestions?
    Thanks in advance!

  2. #2
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: watchdog timer implementation based on QTimer

    Hi,
    Can you post the initialization part of your QTimer.Also, make sure it is not setup for singleshot.

  3. The following user says thank you to QbelcorT for this useful post:

    araglin (18th May 2009)

  4. #3
    Join Date
    Dec 2008
    Posts
    32
    Thanks
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: watchdog timer implementation based on QTimer

    Hello.
    Thanks for your reaction, but I worked out this problem....


    People, sorry, this topic is solved, it can be closed.
    There was my mistake - bug in emiting of MOTION-signal

    But look at it from bright side - now it's tested that QTimer's combination stop()-start() works...
    Sorry again

  5. #4
    Join Date
    Dec 2008
    Posts
    32
    Thanks
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: watchdog timer implementation based on QTimer

    Quote Originally Posted by QbelcorT View Post
    Hi,
    Can you post the initialization part of your QTimer.Also, make sure it is not setup for singleshot.
    by the way, singleshot timer is ok for that algorithm... I called setSingleShot(true) when init it.

Similar Threads

  1. QTimer based Splash Screen
    By bpetty in forum Newbie
    Replies: 6
    Last Post: 15th December 2006, 01:51
  2. Replies: 1
    Last Post: 20th January 2006, 13:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.