edu.wpi.first.wpilibj
Class Module

java.lang.Object
  extended by edu.wpi.first.wpilibj.SensorBase
      extended by edu.wpi.first.wpilibj.Module
All Implemented Interfaces:
FrcBotSimComponent
Direct Known Subclasses:
AnalogModule, DigitalModule

public class Module
extends SensorBase

Base class for AnalogModule and DigitalModule.

Author:
dtjones

Field Summary
protected  CRIOModule m_hwModule
          The module number of the module
protected  int m_moduleNumber
           
protected  ModulePresence.ModuleType m_moduleType
           
 
Fields inherited from class edu.wpi.first.wpilibj.SensorBase
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond, n_simProperties
 
Constructor Summary
protected Module(ModulePresence.ModuleType moduleType, int moduleNumber)
          Constructor.
 
Method Summary
static Module getModule(ModulePresence.ModuleType moduleType, int moduleNumber)
          Static module singleton factory.
 int getModuleNumber()
          Gets the module number associated with a module.
 ModulePresence.ModuleType getModuleType()
          Gets the module type associated with a module.
 
Methods inherited from class edu.wpi.first.wpilibj.SensorBase
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, free, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, getSimProperties, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_hwModule

protected CRIOModule m_hwModule
The module number of the module


m_moduleNumber

protected int m_moduleNumber

m_moduleType

protected ModulePresence.ModuleType m_moduleType
Constructor Detail

Module

protected Module(ModulePresence.ModuleType moduleType,
                 int moduleNumber)
Constructor.

Parameters:
moduleNumber - The number of this module (1 or 2).
Method Detail

getModuleNumber

public int getModuleNumber()
Gets the module number associated with a module.

Returns:
The module's number.

getModuleType

public ModulePresence.ModuleType getModuleType()
Gets the module type associated with a module.

Returns:
The module's type.

getModule

public static Module getModule(ModulePresence.ModuleType moduleType,
                               int moduleNumber)
Static module singleton factory.

Parameters:
moduleType - The type of the module represented.
moduleNumber - The module index within the module type.

Returns:
the module