Now you can download a copy of these docs so you can use them offline! Download now

MotorSafetyHelper Class Reference

Inheritance diagram for MotorSafetyHelper:
Collaboration diagram for MotorSafetyHelper:

List of all members.

Public Member Functions

 MotorSafetyHelper (MotorSafety *safeObject)
void Feed ()
void SetExpiration (float expirationTime)
float GetExpiration ()
bool IsAlive ()
void Check ()
void SetSafetyEnabled (bool enabled)
bool IsSafetyEnabled ()

Static Public Member Functions

static void CheckMotors ()

Detailed Description

Definition at line 15 of file MotorSafetyHelper.h.


Constructor & Destructor Documentation

MotorSafetyHelper::MotorSafetyHelper ( MotorSafety safeObject  ) 

The constructor for a MotorSafetyHelper object. The helper object is constructed for every object that wants to implement the Motor Safety protocol. The helper object has the code to actually do the timing and call the motors Stop() method when the timeout expires. The motor object is expected to call the Feed() method whenever the motors value is updated.

Parameters:
safeObject a pointer to the motor object implementing MotorSafety. This is used to call the Stop() method on the motor.

Definition at line 29 of file MotorSafetyHelper.cpp.


Member Function Documentation

void MotorSafetyHelper::Check (  ) 

Check if this motor has exceeded its timeout. This method is called periodically to determine if this motor has exceeded its timeout value. If it has, the stop method is called, and the motor is shut down until its value is updated again.

Definition at line 113 of file MotorSafetyHelper.cpp.

void MotorSafetyHelper::CheckMotors (  )  [static]

Check the motors to see if any have timed out. This static method is called periodically to poll all the motors and stop any that have timed out.

Definition at line 154 of file MotorSafetyHelper.cpp.

float MotorSafetyHelper::GetExpiration (  ) 

Retrieve the timeout value for the corresponding motor safety object.

Returns:
the timeout value in seconds.

Definition at line 93 of file MotorSafetyHelper.cpp.

bool MotorSafetyHelper::IsAlive (  ) 

Determine if the motor is still operating or has timed out.

Returns:
a true value if the motor is still operating normally and hasn't timed out.

Definition at line 102 of file MotorSafetyHelper.cpp.

bool MotorSafetyHelper::IsSafetyEnabled (  ) 

Return the state of the motor safety enabled flag Return if the motor safety is currently enabled for this devicce.

Returns:
True if motor safety is enforced for this device

Definition at line 143 of file MotorSafetyHelper.cpp.

void MotorSafetyHelper::SetSafetyEnabled ( bool  enabled  ) 

Enable/disable motor safety for this device Turn on and off the motor safety option for this PWM object.

Parameters:
enabled True if motor safety is enforced for this object

Definition at line 133 of file MotorSafetyHelper.cpp.


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

Generated on Thu Jan 12 2012 22:35:33 for WPILibC++ by doxygen 1.7.1