SensorBase Class Reference

#include <SensorBase.h>

Inheritance diagram for SensorBase:

Inheritance graph
[legend]
Collaboration diagram for SensorBase:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SensorBase (void)
virtual ~SensorBase ()
unsigned int GetError (void)
void ClearError (void)

Static Public Member Functions

static void SetDefaultAnalogModule (unsigned slot)
static void SetDefaultDigitalModule (unsigned slot)
static void SetDefaultSolenoidModule (unsigned slot)
static void DeleteSingletons (void)

Protected Member Functions

void AddToSingletonList (void)

Static Protected Member Functions

static void CheckDigitalModule (unsigned slot)
static void CheckRelayModule (unsigned slot)
static void CheckPWMModule (unsigned slot)
static void CheckSolenoidModule (unsigned slot)
static void CheckAnalogModule (unsigned slot)
static void CheckDigitalChannel (unsigned channel)
static void CheckRelayChannel (unsigned channel)
static void CheckPWMChannel (unsigned channel)
static void CheckAnalogChannel (unsigned channel)
static void CheckSolenoidChannel (unsigned channel)


Detailed Description

Base class for all sensors. Stores most recent status information as well as containing utility functions for checking channels and error processing.

Constructor & Destructor Documentation

SensorBase::SensorBase ( void   ) 

Creates an instance of the sensor base and gets an FPGA handle

SensorBase::~SensorBase (  )  [virtual]

Frees the resources for a SensorBase.


Member Function Documentation

unsigned int SensorBase::GetError ( void   ) 

Retrieve the current error. Get the current error value associated with this sensor.

void SensorBase::ClearError ( void   ) 

Clear the current error value associated with this sensor.

void SensorBase::SetDefaultAnalogModule ( unsigned  slot  )  [static]

Sets the default Analog module. This sets the default analog module to use for objects that are created without specifying the analog module in the constructor. The default module is initialized to the first module in the chassis.

void SensorBase::SetDefaultDigitalModule ( unsigned  slot  )  [static]

Sets the default Digital Module. This sets the default digital module to use for objects that are created without specifying the digital module in the constructor. The default module is initialized to the first module in the chassis.

void SensorBase::SetDefaultSolenoidModule ( unsigned  slot  )  [static]

Set the default location for the Solenoid (9472) module. Currently the module must be in slot 8, but it might change in the future.

void SensorBase::DeleteSingletons ( void   )  [static]

Delete all the singleton classes on the list. All the classes that were allocated as singletons need to be deleted so their resources can be freed.

void SensorBase::CheckDigitalModule ( unsigned  slot  )  [static, protected]

Check that the digital module number is valid. Module numbers are the slot number that they are inserted in.

void SensorBase::CheckRelayModule ( unsigned  slot  )  [static, protected]

Check that the digital module number is valid. Module numbers are the slot number that they are inserted in.

void SensorBase::CheckPWMModule ( unsigned  slot  )  [static, protected]

Check that the digital module number is valid. Module numbers are the slot number that they are inserted in.

void SensorBase::CheckSolenoidModule ( unsigned  slot  )  [static, protected]

Verify that the solenoid module is correct. Verify that the solenoid module is slot 8 (for now).

void SensorBase::CheckAnalogModule ( unsigned  slot  )  [static, protected]

Check that the analog module number is valid. Module numbers are the slot numbers that they are inserted in.

void SensorBase::CheckDigitalChannel ( unsigned  channel  )  [static, protected]

Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.

void SensorBase::CheckRelayChannel ( unsigned  channel  )  [static, protected]

Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.

void SensorBase::CheckPWMChannel ( unsigned  channel  )  [static, protected]

Check that the digital channel number is valid. Verify that the channel number is one of the legal channel numbers. Channel numbers are 0-based.

void SensorBase::CheckAnalogChannel ( unsigned  channel  )  [static, protected]

Check that the analog channel number is value. Verify that the analog channel number is one of the legal channel numbers. Channel numbers are 1-based.

void SensorBase::CheckSolenoidChannel ( unsigned  channel  )  [static, protected]

Verify that the solenoid channel number is within limits.

void SensorBase::AddToSingletonList ( void   )  [protected]

Add sensor to the singleton list. Add this sensor to the list of singletons that need to be deleted when the robot program exits. Each of the sensors on this list are singletons, that is they aren't allocated directly with new, but instead are allocated by the static GetInstance method. As a result, they are never deleted when the program exits. Consequently these sensors may still be holding onto resources and need to have their destructors called at the end of the program.


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

Generated on Thu Oct 2 14:01:31 2008 for WPI Robotics Library by  doxygen 1.5.5