WPILibC++  trunk
Public Member Functions | List of all members
Compressor Class Reference

#include <Compressor.h>

Inheritance diagram for Compressor:
Inheritance graph
[legend]
Collaboration diagram for Compressor:
Collaboration graph
[legend]

Public Member Functions

 Compressor (uint32_t pressureSwitchChannel, uint32_t compressorRelayChannel)
 
 Compressor (uint8_t pressureSwitchModuleNumber, uint32_t pressureSwitchChannel, uint8_t compresssorRelayModuleNumber, uint32_t compressorRelayChannel)
 
 ~Compressor ()
 
void Start ()
 
void Stop ()
 
bool Enabled ()
 
uint32_t GetPressureSwitchValue ()
 
void SetRelayValue (Relay::Value relayValue)
 
void UpdateTable ()
 
void StartLiveWindowMode ()
 
void StopLiveWindowMode ()
 
std::string GetSmartDashboardType ()
 
void InitTable (ITable *subTable)
 
ITableGetTable ()
 
- Public Member Functions inherited from SensorBase
 SensorBase ()
 
virtual ~SensorBase ()
 
- Public Member Functions inherited from ErrorBase
virtual ErrorGetError ()
 Retrieve the current error. Get the current error information associated with this sensor.
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (ErrorBase *rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SensorBase
static void DeleteSingletons ()
 
static uint32_t GetDefaultAnalogModule ()
 
static uint32_t GetDefaultDigitalModule ()
 
static uint32_t GetDefaultSolenoidModule ()
 
static bool CheckAnalogModule (uint8_t moduleNumber)
 
static bool CheckDigitalModule (uint8_t moduleNumber)
 
static bool CheckPWMModule (uint8_t moduleNumber)
 
static bool CheckRelayModule (uint8_t moduleNumber)
 
static bool CheckSolenoidModule (uint8_t moduleNumber)
 
static bool CheckDigitalChannel (uint32_t channel)
 
static bool CheckRelayChannel (uint32_t channel)
 
static bool CheckPWMChannel (uint32_t channel)
 
static bool CheckAnalogChannel (uint32_t channel)
 
static bool CheckSolenoidChannel (uint32_t channel)
 
- Static Public Member Functions inherited from ErrorBase
static void SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber)
 
static void SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber)
 
static ErrorGetGlobalError ()
 
- Static Public Attributes inherited from SensorBase
static const uint32_t kSystemClockTicksPerMicrosecond = 40
 
static const uint32_t kDigitalChannels = 14
 
static const uint32_t kAnalogChannels = 8
 
static const uint32_t kAnalogModules = 2
 
static const uint32_t kDigitalModules = 2
 
static const uint32_t kSolenoidChannels = 8
 
static const uint32_t kSolenoidModules = 2
 
static const uint32_t kPwmChannels = 10
 
static const uint32_t kRelayChannels = 8
 
static const uint32_t kChassisSlots = 8
 
- Protected Member Functions inherited from SensorBase
void AddToSingletonList ()
 
- Protected Member Functions inherited from ErrorBase
 ErrorBase ()
 Initialize the instance status to 0 for now.
 
- Protected Attributes inherited from ErrorBase
Error m_error
 
- Static Protected Attributes inherited from ErrorBase
static SEM_ID _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
 
static Error _globalError
 

Detailed Description

Compressor object. The Compressor object is designed to handle the operation of the compressor, pressure sensor and relay for a FIRST robot pneumatics system. The Compressor object starts a task which runs in the backround and periodically polls the pressure sensor and operates the relay that controls the compressor.

Definition at line 26 of file Compressor.h.

Constructor & Destructor Documentation

Compressor::Compressor ( uint32_t  pressureSwitchChannel,
uint32_t  compressorRelayChannel 
)

Compressor constructor. Given a relay channel and pressure switch channel (both in the default digital module), initialize the Compressor object.

You MUST start the compressor by calling the Start() method.

Parameters
pressureSwitchChannelThe GPIO channel that the pressure switch is attached to.
compressorRelayChannelThe relay channel that the compressor relay is attached to.

Definition at line 96 of file Compressor.cpp.

Compressor::Compressor ( uint8_t  pressureSwitchModuleNumber,
uint32_t  pressureSwitchChannel,
uint8_t  compresssorRelayModuleNumber,
uint32_t  compressorRelayChannel 
)

Compressor constructor. Given a fully specified relay channel and pressure switch channel, initialize the Compressor object.

You MUST start the compressor by calling the Start() method.

Parameters
pressureSwitchModuleNumberThe digital module that the pressure switch is attached to.
pressureSwitchChannelThe GPIO channel that the pressure switch is attached to.
compresssorRelayModuleNumberThe digital module that the compressor relay is attached to.
compressorRelayChannelThe relay channel that the compressor relay is attached to.

Definition at line 74 of file Compressor.cpp.

Compressor::~Compressor ( )

Delete the Compressor object. Delete the allocated resources for the compressor and kill the compressor task that is polling the pressure switch.

Definition at line 110 of file Compressor.cpp.

Member Function Documentation

bool Compressor::Enabled ( )

Get the state of the enabled flag. Return the state of the enabled flag for the compressor and pressure switch combination.

Returns
The state of the compressor thread's enable flag.

Definition at line 163 of file Compressor.cpp.

uint32_t Compressor::GetPressureSwitchValue ( )

Get the pressure switch value. Read the pressure switch digital input.

Returns
The current state of the pressure switch.

Definition at line 132 of file Compressor.cpp.

std::string Compressor::GetSmartDashboardType ( )
virtual
Returns
the string representation of the named data type that will be used by the smart dashboard for this sendable

Implements Sendable.

Definition at line 183 of file Compressor.cpp.

ITable * Compressor::GetTable ( )
virtual
Returns
the table that is currently associated with the sendable

Implements Sendable.

Definition at line 192 of file Compressor.cpp.

void Compressor::InitTable ( ITable subtable)
virtual

Initializes a table for this sendable object.

Parameters
subtableThe table to put the values in.

Implements Sendable.

Definition at line 187 of file Compressor.cpp.

void Compressor::SetRelayValue ( Relay::Value  relayValue)

Operate the relay for the compressor. Change the value of the relay output that is connected to the compressor motor. This is only intended to be called by the internal polling thread.

Definition at line 121 of file Compressor.cpp.

void Compressor::Start ( )

Start the compressor. This method will allow the polling loop to actually operate the compressor. The is stopped by default and won't operate until starting it.

Definition at line 142 of file Compressor.cpp.

void Compressor::StartLiveWindowMode ( )
virtual

Start having this sendable object automatically respond to value changes reflect the value on the table.

Implements LiveWindowSendable.

Definition at line 175 of file Compressor.cpp.

void Compressor::Stop ( )

Stop the compressor. This method will stop the compressor from turning on.

Definition at line 151 of file Compressor.cpp.

void Compressor::StopLiveWindowMode ( )
virtual

Stop having this sendable object automatically respond to value changes.

Implements LiveWindowSendable.

Definition at line 179 of file Compressor.cpp.

void Compressor::UpdateTable ( )
virtual

Update the table for this sendable object with the latest values.

Implements LiveWindowSendable.

Definition at line 168 of file Compressor.cpp.


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