direcs  2012-09-30
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Heartbeat Class Reference

This thread sends a heartbeat to the microcontroller. The microccontroller waits for this heartsbeats. It stops/resets the robot, if no heartbeats are received. More...

#include <heartbeat.h>

Collaboration diagram for Heartbeat:

List of all members.

Public Slots

void setRobotState (bool state)

Signals

void alarm ()

Public Member Functions

 Heartbeat (InterfaceAvr *i, QMutex *m)
void init ()
bool isConnected (void)
virtual void run ()
void stop ()
 ~Heartbeat ()

Private Attributes

bool initDone
InterfaceAvrinterface1
QMutex * mutex
 Stores the robots (circuits) state.ON or OFF.
bool robotIsOn
volatile bool stopped

Static Private Attributes

static const unsigned long THREADSLEEPTIME = 500

Detailed Description

This thread sends a heartbeat to the microcontroller. The microccontroller waits for this heartsbeats. It stops/resets the robot, if no heartbeats are received.

Definition at line 34 of file heartbeat.h.


Constructor & Destructor Documentation

Heartbeat::Heartbeat ( InterfaceAvr i,
QMutex *  m 
)

Definition at line 24 of file heartbeat.cpp.

Heartbeat::~Heartbeat ( )

Definition at line 36 of file heartbeat.cpp.


Member Function Documentation

void Heartbeat::alarm ( )
signal

TODO: text text text alarm

void Heartbeat::init ( )

Definition at line 87 of file heartbeat.cpp.

bool Heartbeat::isConnected ( void  )

Definition at line 81 of file heartbeat.cpp.

void Heartbeat::run ( )
virtual

Definition at line 47 of file heartbeat.cpp.

Here is the call graph for this function:

void Heartbeat::setRobotState ( bool  state)
slot

This slot sets (stores) the robots (circuits) state within this class.

Parameters:
statecan be ON or OFF

Definition at line 112 of file heartbeat.cpp.

void Heartbeat::stop ( )

Definition at line 41 of file heartbeat.cpp.


Member Data Documentation

bool Heartbeat::initDone
private

Definition at line 71 of file heartbeat.h.

InterfaceAvr* Heartbeat::interface1
private

Definition at line 75 of file heartbeat.h.

QMutex* Heartbeat::mutex
mutableprivate

Stores the robots (circuits) state.ON or OFF.

Definition at line 74 of file heartbeat.h.

bool Heartbeat::robotIsOn
private

Definition at line 73 of file heartbeat.h.

volatile bool Heartbeat::stopped
private

Definition at line 72 of file heartbeat.h.

const unsigned long Heartbeat::THREADSLEEPTIME = 500
staticprivate

Definition at line 79 of file heartbeat.h.


The documentation for this class was generated from the following files: